public static void InvokeOnKilled(LifeControl life) { if (OnKilled != null) { OnKilled(life); } }
// Start is called before the first frame update void Start() { fruitRb = GetComponent <Rigidbody2D>(); scoreText = GameObject.FindGameObjectWithTag("Score").GetComponent <Text>(); lifeControl = GameObject.FindGameObjectWithTag("Life").GetComponent <LifeControl>(); fruitRb.AddForce(transform.up * force, ForceMode2D.Impulse); }
void UpdatePlayerOneUnitText() { if (UC.ListOneCount() == 0) { return; } List <GameObject> mUnitList = UC.GetPlayerOneUnits(); if (mUnitList == null) { return; } int unitcount = 0; mPlayerOneUnitsText = "Player One's Units \n"; foreach (var obj in mUnitList) { BasicUnitScript BS = obj.GetComponent <BasicUnitScript>(); LifeControl LC = obj.GetComponent <LifeControl>(); BlobProperties BP = obj.GetComponent <BlobProperties>(); unitcount++; mPlayerOneUnitsText = mPlayerOneUnitsText + "Unit " + unitcount + ": " + BS.GetUnitName() + ". OwnerID: " + BS.GetOwnerID() + ". UnitID: " + BS.GetUnitID() + "\n" + " HP: " + LC.GetHP() + " Enemeies in Range: " + BP.enemiesInRange.Count + " Enemies in Sight: " + BP.enemiesInSight.Count + " \n"; } mPlayerOneUnits.text = mPlayerOneUnitsText; }
void Start() { col = GetComponent <BoxCollider2D>(); lc = GetComponent <LifeControl>(); bite = GetComponent <Bite>(); jumpAnim.frameTime = float.PositiveInfinity; timeStart = Time.time; }
void Start() { lifeControl = GameObject.Find("LifeBase").GetComponent <LifeControl> (); GetComponent <MeshRenderer> ().material.color = neutralColor; boxCollider = GetComponent <BoxCollider> (); CalculateRaySpacing(); }
public Control(int player_id) { this.setPlayersIds(player_id); this.field = new Field(this); this.battleControl = new BattleControl(this, field); this.lifeControl = new LifeControl(player_id, opponent_id); this.mana = new ManaControl(this); this.effects_control = new EffectsControl(this); this.hand = GameObject.FindGameObjectWithTag("Hand").GetComponent <Hand>(); }
// Use this for initialization void Start() { life = GameObject.FindGameObjectWithTag("life").GetComponent<LifeControl>(); }
// Use this for initialization void Start() { life = FindObjectOfType <LifeControl>(); sound = PlayerPrefs.GetInt("sound"); scoreCount = FindObjectOfType <ScoreCounter>(); }
void Awake() { m_turnControl = new TurnControl (); List<int> turns = new List<int>(2); turns.Add (TurnControl.TURN_PLAYER); turns.Add (TurnControl.TURN_ENEMY_1); m_turnControl.initTurns (turns); m_playerLifeControl = GameObject.Find ("LifeText").GetComponent<LifeControl>(); GameObject[] enemyObjs = GameObject.FindGameObjectsWithTag("Enemy"); enemys = new ArrayList(); foreach (GameObject t in enemyObjs) { enemys.Add(t.GetComponent<EnemyControl>()); } // slideControl = gameObject.GetComponent<SlideResultControl>(); slideControl.slideDelegates += slideTo; candys = new Dictionary<int, GameObject> (); //create candys for (int i = 0; i < mapRow; i++) { for(int j = 0 ; j < mapLine ;j++) { GameObject t = createCandyBy(i,j,randomCandyType()); candys.Add(i*ROW_SCALE_FOR_KEY + j,t); } } }