Exemple #1
0
    public void SpawnSkill(SkillType skillType, Camp camp, Vector3 pos)
    {
        GameObject go = Game.Instance.ObjectPool.Spawn(skillType.ToString() + "_" + camp.ToString());

        go.transform.position = pos + Vector3.up * 10;
        StartCoroutine(DestroyCoroutine(go.GetComponent <Skill>(), go.GetComponent <Skill>().DelayToDestroy));
    }
 protected static int GetAgainstLayerMask(Camp layer)
 {
     if (layer.ToString() == "Player")
     {
         return(LayerMask.GetMask("Enemy"));
     }
     return(LayerMask.GetMask("Player"));
 }
Exemple #3
0
    public void SpawnSoldier(Arm arm, Camp camp, Vector3 pos)
    {
        GameObject go = Game.Instance.ObjectPool.Spawn(arm.ToString() + "_" + camp.ToString());

        go.transform.position = pos;
        Soldier soldier = go.GetComponent <Soldier>();

        soldier.HpChanged += Soldier_HpChanged;
        soldier.Dead      += Soldier_Dead;
    }