公告版位
需要找什麼嗎? 左邊分類或許可以幫助你...
from gimpfu import *
 
def say_hello_world(img, layer) :    
    gimp.set_foreground(0, 250, 0) # 設定前景顏色
    gimp.set_background(0, 0, 250) # 設定背景顏色 
    gimp.message("Is Change Color") # 設定完後,在下方顯示訊息
 
register(
    "python_fu_test_hello_world",
    "Hello world",

黃彥霖 發表在 痞客邦 留言(0) 人氣()

基本上這次程式碼主要是用程式來產生 Sin 正弦波聲音,波形圖如下:

Sine_waves_different_frequencies  

以下為執行結果,可以使用滑桿來改變聲音頻率:

Unity - A.unity - New Unity Project 31 - PC, Mac & Linux Standalone  


using UnityEngine;

黃彥霖 發表在 痞客邦 留言(0) 人氣()

在 C# 寫入以下程式碼,並在腳本外部加入 Audio Source 的元件。
遊戲開始後即可聽見自己的麥克風聲音。

void Start () {
    audio.clip = Microphone.Start("Built-in Microphone", true, 1000, 44100);
    audio.pitch = 0.995f;
    audio.Play();
}

Unity - A.unity - New Unity Project 29 - PC, Mac & Linux Standalone  

黃彥霖 發表在 痞客邦 留言(4) 人氣()

using UnityEngine;
using System.Collections;

public class MyCamera : MonoBehaviour {
/*
This camera smoothes out rotation around the y-axis and height.
Horizontal Distance to the target is always fixed.

There are many different ways to smooth the rotation but doing it this way gives you a lot of control over how the camera behaves.

For every of those smoothed values we calculate the wanted value and the current value.
Then we smooth it using the Lerp function.
Then we apply the smoothed values to the transform's position.

黃彥霖 發表在 痞客邦 留言(0) 人氣()

實際運行效果:

Unity - MainMenu.unity - New Unity Project 26 - PC, Mac & Linux Standalone

編輯環境效果:

Unity - MainMenu.unity - New Unity Project 26 - PC, Mac & Linux Standalone_2

請先在場景中建立五個 Plane 平面物件,之後在 Level Switch 中 Size 輸入5,把剛剛5個Plane平面物件一個一個拉進去。
之後在 Image 中輸入圖片數量(最好超過五個),再將各圖片拉進去。
之後按下執行,用鍵盤按左右建,即可看見圖片切換效果。

黃彥霖 發表在 痞客邦 留言(1) 人氣()