示例#1
0
    void Fader_Edge(ZigFader f)
    {
        if (f != waveFader)
        {
            return;
        }

        // prune
        while (timestampBuffer.Count > 0 && (Time.time - timestampBuffer[0] > 2.0f))
        {
            timestampBuffer.RemoveAt(0);
        }

        if (timestampBuffer.Count == 0)
        {
            lastEdge = -1;
        }

        if (!Mathf.Approximately(lastEdge, f.value))
        {
            timestampBuffer.Add(Time.time);
        }

        lastEdge = f.value;
        if (timestampBuffer.Count >= Waves)
        {
            wavePoint = waveFader.GetPosition(0.5f);
            OnWave();
            timestampBuffer.Clear();
        }
    }
示例#2
0
    // Use this for initialization
    void Awake()
    {
        horizFader             = gameObject.AddComponent <ZigFader>();
        horizFader.direction   = Vector3.right;
        horizFader.driftAmount = 15;
        horizFader.Edge       += delegate {
            if (Mathf.Approximately(horizFader.value, 0))
            {
                DoSwipe("Left");
            }
            else
            {
                DoSwipe("Right");
            }
        };

        vertFader             = gameObject.AddComponent <ZigFader>();
        vertFader.direction   = Vector3.up;
        vertFader.driftAmount = 10;
        vertFader.Edge       += delegate {
            if (Mathf.Approximately(horizFader.value, 0))
            {
                DoSwipe("Down");
            }
            else
            {
                DoSwipe("Up");
            }
        };
    }
	// Use this for initialization
	void Awake () {
        horizFader = gameObject.AddComponent<ZigFader>();
        horizFader.direction = Vector3.right;
        horizFader.driftAmount = 15;
        horizFader.Edge += delegate {
            if (Mathf.Approximately(horizFader.value, 0)) {
                DoSwipe("Left");
            }
            else {
                DoSwipe("Right");
            }
        };

        vertFader = gameObject.AddComponent<ZigFader>();
        vertFader.direction = Vector3.up;
        vertFader.driftAmount = 10;
        vertFader.Edge += delegate {
            if (Mathf.Approximately(horizFader.value, 0)) {
                DoSwipe("Down");
            }
            else {
                DoSwipe("Up");
            }
        };
	}
示例#4
0
 void Awake()
 {
     timestampBuffer       = new List <float>();
     waveFader             = gameObject.AddComponent <ZigFader>();
     waveFader.size        = 100;
     waveFader.driftAmount = 15;
 }
示例#5
0
    void Fader_HoverStart(ZigFader fader)
    {
        currentItem = fader.hoverItem;

        output.text = fader.hoverItem.ToString();

        origColor = items[fader.hoverItem].GetComponent <Renderer>().material.color;
        items[fader.hoverItem].GetComponent <Renderer>().material.color = hoverColor;
        //   Debug.Log("HoverStart: " + fader.hoverItem.ToString());
    }
示例#6
0
    void Fader_HoverStart(ZigFader fader)
    {
        currentItem = fader.hoverItem;

        output.text = fader.hoverItem.ToString();
        
        origColor = items[fader.hoverItem].GetComponent<Renderer>().material.color;
        items[fader.hoverItem].GetComponent<Renderer>().material.color = hoverColor;
     //   Debug.Log("HoverStart: " + fader.hoverItem.ToString());
    }
    void Fader_Edge(ZigFader f) {
        
        if (f != waveFader) return;

        // prune
        while (timestampBuffer.Count > 0 && (Time.time - timestampBuffer[0] > 2.0f)) {
            timestampBuffer.RemoveAt(0);
        }

        if (timestampBuffer.Count == 0) {
            lastEdge = -1;
        }

        if (!Mathf.Approximately(lastEdge, f.value)) {
            timestampBuffer.Add(Time.time);
        }

        lastEdge = f.value;
        if (timestampBuffer.Count >= Waves) {
            wavePoint = waveFader.GetPosition(0.5f);
            OnWave();
            timestampBuffer.Clear();
        }
    }
示例#8
0
 void Start()
 {
     pushFader           = gameObject.AddComponent <ZigFader>();
     pushFader.direction = -Vector3.forward;
 }
示例#9
0
 void Fader_ValueChange(ZigFader fader)
 {
     nub.localPosition = Vector3.Lerp(point0, point1, fader.value);
 }
示例#10
0
 void Fader_HoverStop(ZigFader fader)
 {
     items[fader.hoverItem].GetComponent <Renderer>().material.color = origColor;
     //  Debug.Log("HoverStop: " + fader.hoverItem.ToString());
 }
示例#11
0
 void Fader_ValueChange(ZigFader fader)
 {
    
     nub.localPosition = Vector3.Lerp(point0, point1, fader.value);
 }
示例#12
0
 void Fader_HoverStop(ZigFader fader)
 {
     items[fader.hoverItem].GetComponent<Renderer>().material.color = origColor; 
   //  Debug.Log("HoverStop: " + fader.hoverItem.ToString());
 }
 void Awake() {
     timestampBuffer = new List<float>();
     waveFader = gameObject.AddComponent<ZigFader>();
     waveFader.size = 100;
     waveFader.driftAmount = 15;
 }
    void Start()
	{
        pushFader = gameObject.AddComponent<ZigFader>();
        pushFader.direction = -Vector3.forward;
	}