Esempio n. 1
0
    protected virtual void Start()
    {
        playerInstance = PlayerInstant.Instance;

        p_movementModel = playerInstance.GetComponent <CharacterMovementModel>();
        playerStats     = playerInstance.GetComponent <PlayerStats>();

        spawnCount = 0;

        enemyAction = basicAction;

        GetComponent <CircleCollider2D>().radius = 3f;
    }
Esempio n. 2
0
    private void CreateInstantiatePikcup()
    {
        GameObject tempDecoy = Instantiate(tempInstantiateObject);

        tempDecoy.SetActive(true);

        CharacterMovementModel m_movementModel = playerInstance.GetComponent <CharacterMovementModel>();
        Vector2 facingDirection = m_movementModel.GetFacingDirection();

        if (facingDirection.x == 1)
        {
            tempDecoy.transform.position = new Vector3
                                               (playerInstance.transform.position.x + 0.5f, playerInstance.transform.position.y, 0);
        }
        else if (facingDirection.x == -1)
        {
            tempDecoy.transform.position = new Vector3
                                               (playerInstance.transform.position.x - 0.5f, playerInstance.transform.position.y, 0);
        }
        else if (facingDirection.y == 1)
        {
            tempDecoy.transform.position = new Vector3
                                               (playerInstance.transform.position.x, playerInstance.transform.position.y + 0.5f, 0);
        }
        else
        {
            tempDecoy.transform.position = new Vector3
                                               (playerInstance.transform.position.x, playerInstance.transform.position.y - 0.5f, 0);
        }
    }