コード例 #1
0
ファイル: Victim.cs プロジェクト: welshtor/GameLogicTools
 private void Start()
 {
     am    = GameObject.FindGameObjectWithTag("Audio Manager").GetComponent <AudioManager>();
     gm    = GameObject.FindGameObjectWithTag("Game Manager").GetComponent <GameManager>();
     vd    = GameObject.FindGameObjectWithTag("Victim").GetComponent <VictimDaddy>();
     Delay = GameObject.FindGameObjectWithTag("Game Manager").GetComponent <GameManager>().Delay_Between_Spawns;
 }
コード例 #2
0
ファイル: Victim.cs プロジェクト: welshtor/GameLogicTools
    private void Update()
    {
        if (this.gameObject.GetComponent <Mover>().Alive == false)
        {
            //detach the object and tell the mover script to stop moving
            detached = true;
            GameObjectChild.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.None;

            //Spawn blood effects
            //GameObject fx = Instantiate(bloodFX, GameObjectChild.transform.position, Quaternion.identity);
            //Destroy(fx, 2f);

            GameObjectChild.parent = null;
            if (detached)
            {
                Destroy(this.gameObject, death_duration);
            }
            if (this.gameObject == GameObject.Find("Head") || this.gameObject == GameObject.Find("Torso"))
            {
                Destroy(GameObjectChild.parent, death_duration);
            }

            //If the GameObject has the same tag as specified, output this message in the console
            Debug.Log("Detach Object From parent and stop body part");
        }
        vd = GameObject.FindGameObjectWithTag("Victim").GetComponent <VictimDaddy>();
        print(vd);
    }
コード例 #3
0
 void Awake()
 {
     _instance = this;
     am        = GameObject.FindGameObjectWithTag("Audio Manager").GetComponent <AudioManager>();
     vd        = GameObject.FindGameObjectWithTag("Victim").GetComponent <VictimDaddy>();
     BC        = GameObject.Find("BetterCubor");
 }