public void DoRun(SimpleAI sAI, string code) { if (code == "Die") { sAI.Destroy(); } TreeObject to = (TreeObject)sAI.mCharacter; if (to.timer < 1.0f) { to.timer += Time.deltaTime; return; } SimpleAI[] SimpleAIs = SimpleAISetSingleton.getInstance().GetComponent <SimpleAISet> ().FindAIsWithRiaus(sAI.mAIRT.transform.position, 5.0f, 1 << LayerMask.NameToLayer("Default"), "Glass"); to.timer = 0.0f; to.mTempLife -= 180 + (int)(30 * to.mStrongRate); for (int i = 0; i < SimpleAIs.Length; i++) { glassObject go = (glassObject)SimpleAIs [i].mCharacter; if (go.mHp > 500) { to.mTempLife += (int)(go.mHp / 500.0f); //Debug.Log ("Grass"); } } }
public void DoRun(SimpleAI sAI, string code) { if (code == "Die") { sAI.Destroy(); } glassObject go = (glassObject)sAI.mCharacter; if (go.timer < 1.0f) { go.timer += Time.deltaTime; return; } SimpleAI[] SimpleAIs = SimpleAISetSingleton.getInstance().GetComponent <SimpleAISet> ().FindAIsWithRiaus(sAI.mAIRT.transform.position, 5.0f, 1 << LayerMask.NameToLayer("Default"), "Tree"); go.timer = 0.0f; go.mHp -= 50; for (int i = 0; i < SimpleAIs.Length; i++) { TreeObject to = (TreeObject)SimpleAIs [i].mCharacter; if (to.mTempLife > 1500) { go.mHp += (int)(to.mTempLife / 50.0f); } } }