Ejemplo n.º 1
0
 void Start()
 {
     target                  = hive;
     targetPosition          = transform.position;
     targetPosition.Duration = 0.2f;
     isFlying                = false;
     numberPaths             = paths.transform.childCount;
     InitPathArgs();
     _logic = Logic.instance;
 }
Ejemplo n.º 2
0
    //Use this instead of Awake since this is a MonoBehaviorSingleton
    //void Awake()
    protected override void Initialize()
    {
        //Expect a Camera component in this class' object
        ourCamera = transform.GetComponent <Camera>() as Camera;
        if (ourCamera == null)
        {
            Debug.LogError("camera == null");
        }

        lookAtTarget = Vector3.zero;

        //Smoothing helpers
        posSmoother = new SmoothVector3(Vector3.zero);
        rotSmoother = new SmoothQuaternion(Quaternion.identity);

        followHmdEnabled = false;
    }
Ejemplo n.º 3
0
    private void SetAnimations()
    {
        _position            = Vector3.up;
        _position.Duration   = 0.1f;
        _personageController = PersonageController.instance;

        Animation animat      = _personageController.sTreeps.animation;
        string    personageId = _personageType + "";

        _animationHorizontal    = new AnimationState[2];
        _animationHorizontal[0] = SetAnimationConfig(animat[personageId + "Left"], 10);
        _animationHorizontal[1] = SetAnimationConfig(animat[personageId + "Right"], 10);

        _animationVertical    = new AnimationState[2];
        _animationVertical[0] = SetAnimationConfig(animat[personageId + "Down"], 11);
        _animationVertical[1] = SetAnimationConfig(animat[personageId + "Up"], 11);
    }
Ejemplo n.º 4
0
    public void OnCompletePath()
    {
        standTime = Random.Range(10.0f, 30.0f);
        // Player has moved the strip and the target is not visible
        int currentLayer = strip.Layer;

        if (currentLayer != target.gameObject.layer)
        {
            Fly();
        }
        else
        {
            iTween.StopByName(animationName);
            isFlying       = false;
            targetPosition = transform.position;
            EndCrossStrip();
            _.Trigger(Triggers.EyesightUnfollow, gameObject);
        }
    }