예제 #1
0
    void LateUpdate()
    {
        Vector3 direction = GridMovement.GetDirectionFromInput();

        if ((clone = cloneAbility.GetClone()))            // intentional assignment

        {
            cloneMovement = clone.GetComponent <GridMovement> ();

            if (!movement.IsMoving() && !cloneMovement.IsMoving())
            {
                movement.MoveInDirection(direction);
                cloneMovement.MoveInDirection(direction);
            }
            else if (cloneMovement.isOnIce && !movement.IsMoving())
            {
                movement.MoveInDirection(direction);
            }
            else if (movement.isOnIce && !cloneMovement.IsMoving())
            {
                cloneMovement.MoveInDirection(direction);
            }
        }
        else if (movement.enabled)
        {
            movement.MoveInDirection(direction);
        }
    }
예제 #2
0
    void Update()
    {
        if (!isActive && Input.GetKeyDown(KeyCode.C) && !playerMovement.IsMoving())
        {
            ActivateClone();
        }
        else if (isActive && Input.GetKeyDown(KeyCode.C))
        {
            DestroyCloneSpawner();              // destroy both for good measure
            DestroyClone(cancelled: true);
            playerMovement.enabled = true;
        }

        if (isActive && cloneSpawner)
        {
            TrackSpawnerDuration();
        }

        if (isActive && clone)
        {
            TrackCloneDuration();
        }

        if (isActive && !cloneSpawner && !clone)
        {
            isActive = false;
        }
    }
예제 #3
0
	void LateUpdate() {
		Vector3 direction = GridMovement.GetDirectionFromInput ();

		if ((clone = cloneAbility.GetClone ())) { // intentional assignment

			cloneMovement = clone.GetComponent<GridMovement> ();

			if (!movement.IsMoving () && !cloneMovement.IsMoving ()) {
				movement.MoveInDirection (direction);
				cloneMovement.MoveInDirection (direction);

			} else if (cloneMovement.isOnIce && !movement.IsMoving ()) {
				movement.MoveInDirection (direction);

			} else if (movement.isOnIce && !cloneMovement.IsMoving ()) {
				cloneMovement.MoveInDirection (direction);
			}
		} else if (movement.enabled) {
			movement.MoveInDirection (direction);
		}
	}