/// <summary>
        /// 初始化接口
        /// </summary>
        /// <param name="control"></param>
        public PlayerPosBehaviour(IPosControl control)
        {
            posControl = control;
            currentPos = new Triggable <Vector2>(control.GetPos(), OnCurrentPosChanged);

            timeSpanCalculator = new TriggerGroup(RecalulateTimeSpan, OnBeforeChange);
            timeSpanCalculator.AddTrigger(targetPos);
            timeSpanCalculator.AddTrigger(speed);
        }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        if (centerX) {
            startX = (int)(Screen.width/2f - width/2f);
        }

        if (centerY) {
            startY = (int)(Screen.height/2f - height/2f);
        }

        state = 0;
        opacity = new Color(1.0f, 1.0f, 1.0f, 1.0f);
        fadeTime = fadeDuration;
        triggable = GetComponent<Triggable>();
    }
Beispiel #3
0
 void Start()
 {
     triggable = gameObject.GetComponent<Triggable>();
     timeRemaining = timeAfterTriggered;
 }
Beispiel #4
0
 public PlayerAnimBehaviour(IAnimControl animControl)
 {
     this.animControl = animControl;
     currentAnim      = new Triggable <string>("stand", OnAnimChanged);
     animControl.PlayAnim("stand", AnimWrapMode.Loop);
 }