Ejemplo n.º 1
0
    void Start()
    {
        if (gameObject.scene.name == "Arcade")
        {
            isArcadeGameing = true;
        }

        if (isArcadeGameing)
        {
            stateManager.State = "Arcade";
            //animator.Play("idle");
            if (transform.position.x >= 0)
            {
                direction =
                    new Vector3(0, 0, 1) * Time.deltaTime;
                transform.Rotate(new Vector3(0, 0, 0));
            }
            else
            {
                direction = new Vector3(0, 0, 1) * Time.deltaTime;
                transform.Rotate(new Vector3(0, 0, 0));
            }
        }
        else
        {
            stateManager.State = "Room";
            Disappearer disappearer = GetComponent <Disappearer>();
            transform.Rotate(new Vector3(0, Random.Range(0, 360), 0));
            locomotionController.DynamicDirectionChange(transform.forward);
            disappearer.Deactivate = true;
            locomotionController.SetSpeed(1f);
            animator.Play("run");
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     arcadeManager        = GameObject.FindObjectOfType <ArcadeManager>();
     myTransform          = transform.parent.transform;
     stateManager         = GetComponentInChildren <StateManager>();
     disappearer          = GetComponent <Disappearer>();
     animator             = GetComponentInParent <Animator>();
     locomotionController = GetComponent <CatchableLocomotionController>();
 }