public void PutRemoteBombPrefab() { if (!putBomb) { remoteBomb = (GameObject)Instantiate(remoteBombPrefab, new Vector3(shotBullet.transform.position.x, 0f, shotBullet.transform.position.z), Quaternion.identity); remoteBomb.GetComponent <RemoteController>().SetController(this.gameObject, shotBullet); SEManager.PlayPutBombSound(); try { UseSkill us = this.transform.parent.transform.gameObject.GetComponent <UseSkill>(); us.SetSkillCountTime(9f); } catch { } } else { SEManager.PlayBombSound(); GameObject Explosion = (GameObject)Instantiate(remoteBombExplosionPrefab, remoteBomb.transform.position, Quaternion.identity); Destroy(remoteBomb); Destroy(Explosion, 0.5f); } putBomb = !putBomb; }
public bool PutWarpPrefab() { if (putWarpPairNum < putAbleWarpPairNum) { if (!putWarp) { SEManager.PlayPutObjectSound1(); warp = (GameObject)Instantiate(warpPrefab, transform.position, Quaternion.identity); warp.GetComponent <Warp>().SetPutter(this.GetComponent <PutObject>()); try { UseSkill us = this.transform.parent.transform.gameObject.GetComponent <UseSkill>(); us.SetSkillCountTime(2.5f); } catch { } } else { SEManager.PlayPutObjectSound1(); GameObject exitwarp = (GameObject)Instantiate(exitWarpPrefab, transform.position, Quaternion.identity); warp.GetComponent <Warp>().SetPareWarp(exitwarp); exitwarp.GetComponent <Warp>().SetPareWarp(warp); exitwarp.GetComponent <Warp>().SetPutter(this.GetComponent <PutObject>()); putWarpPairNum++; StartCoroutine(DelayMethod(10f, () => { exitwarp.GetComponent <Warp>().DestroyWarp(); })); } putWarp = !putWarp; return(true); } return(false); }