void InitializeOwnedMonsterList(List <string> ownedMonsters, int player1Mon, int player2Mon) { GameObject temp = null; float tempX = 0; foreach (string i in ownedMonsters) { // Debug.Log("initializing owned monster # " +i); //load lamina game objects temp = Resources.Load <GameObject>(i + "Lamina_Island"); if (temp == null) { Debug.Log(i + "Lamina_Island not found in Resources"); } temp = GameObject.Instantiate(temp) as GameObject; temp.transform.parent = ownedLaminaParent; //temp code until huts are programmed in temp.transform.localPosition = new Vector3(0, 0, 0); temp.transform.position += new Vector3(tempX, 0, 0); tempX += 5; ownedLamina.Add(temp); LaminaBrain_Island tempBrain = (LaminaBrain_Island)temp.GetComponent <LaminaBrain_Island>(); tempBrain.SetInactive(); players.Add(tempBrain); } equippedLamina[0] = player1Mon; equippedLamina[1] = player2Mon; }
void Die() { if (debug) { Debug.Log("last thing to hit me = " + lastThingToHitMe.name); } LaminaBrain_Island killerBrain = lastThingToHitMe.GetComponent("LaminaBrain_Island") as LaminaBrain_Island; if (killerBrain != null) { killerBrain.GainExperience(exp); } if (debug) { Debug.Log("I, " + myGameObject.name + ", have been killed by " + killerBrain.myGameObject.name); } EruptReward(); }