コード例 #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));
    }
コード例 #2
0
ファイル: MyMono.cs プロジェクト: JeromeLee-ljl/Space-Shooter
 protected static int GetAgainstLayerMask(Camp layer)
 {
     if (layer.ToString() == "Player")
     {
         return(LayerMask.GetMask("Enemy"));
     }
     return(LayerMask.GetMask("Player"));
 }
コード例 #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;
    }