Exemple #1
0
    public void Init(HeroBaseInfo info, TowerPlaceToken token)
    {
        if (gameObject.activeSelf == false)
        {
            gameObject.SetActive(true);
        }

        StopAllCoroutines();

        gameObject.transform.localPosition = new Vector3(0, token.obj.transform.localPosition.y);
        status = new HeroStatus(this, token.FloorIndex, info);

        token.AddPlacedHero(this);

        StartCoroutine("Process");
    }
Exemple #2
0
    public void Init(TowerPlaceToken token, TowerPlacedInfo info)
    {
        if (gameObject.activeSelf == false)
        {
            gameObject.SetActive(true);
        }

        StopAllCoroutines();

        gameObject.transform.localPosition = token.obj.transform.localPosition;
        status = new TowerStatus(this, token.FloorIndex, info);

        SetAtlas();

        if (TowerManager.Instance != null)
        {
            TowerManager.Instance.AddTowerList(this);
        }

        StartCoroutine("AttackMode");
    }