Exemplo n.º 1
0
    void AddTempProperties()
    {
        PlayerPropertie playerPropertie = PlayerManager.Instance.GetPlayerPropertie();

        switch (Color)
        {
        case GridColor.Coin:
            playerPropertie.AddPropertie(PropertiesEnum.Gold);
            break;

        case GridColor.Heart:
            playerPropertie.AddTempNumber(PropertiesEnum.RestoreHP);
            break;

        case GridColor.Earth:
            _targetFlyTo.GetComponent <EnemyPropertie>().AddTempNumber(playerPropertie.GetPropertie(PropertiesEnum.Earth));
            break;

        case GridColor.Water:
            _targetFlyTo.GetComponent <EnemyPropertie>().AddTempNumber(playerPropertie.GetPropertie(PropertiesEnum.Water));
            break;

        case GridColor.Fire:
            _targetFlyTo.GetComponent <EnemyPropertie>().AddTempNumber(playerPropertie.GetPropertie(PropertiesEnum.Fire));
            break;

        case GridColor.Wind:
            _targetFlyTo.GetComponent <EnemyPropertie>().AddTempNumber(playerPropertie.GetPropertie(PropertiesEnum.Wind));
            break;

        default:
            break;
        }
    }
Exemplo n.º 2
0
 void Start()
 {
     name         = Type.ToString();
     _attackLine  = transform.GetComponentInChildren <BezierLine>();
     _propertie   = gameObject.GetComponent <PlayerPropertie>();
     _attackRange = _propertie.GetAttackRange();
 }
Exemplo n.º 3
0
    public GameObject InstantiatePlayer(Vector2 position)
    {
        if (Player != null)
        {
            return(null);
        }

        Player = Instantiate(Resources.Load("Prefabs/Player", typeof(GameObject)) as GameObject);
        Player.transform.SetParent(transform);
        Player.transform.localPosition = position;
        PlayerPosition   = Player.transform.position;
        _playerControl   = Player.GetComponent <PlayerControl>();
        _playerPropertie = Player.GetComponent <PlayerPropertie>();
        return(Player);
    }