private void OnTriggerEnter(Collider other) { if (currentHandState == HandState.Fired) { if (other.tag == "Player") { playerScript = other.transform.parent.GetComponent <PF_Player>(); playerScript.SetCanMove(false); playerScript.ModifyCurrentHealth(-grabDamage); //Craig Added learning data var learning = FindObjectOfType <BossAttacks>(); learning.BlockLearn.Data.Add(new NaiveBayesLearning.InformationModel() { Lable = "Hand", Features = new List <string>() { "Hit", "Attack" } }); other.transform.parent.transform.parent = transform; currentHandState = HandState.Retract; } } }
//START void Start() { //Boss Boss = GameObject.FindGameObjectWithTag("Boss"); //Bullet pattern bulletPattern = GameObject.FindGameObjectWithTag("BossAbilities").GetComponent <BulletPattern>(); //Player GameObject[] playerTagged = GameObject.FindGameObjectsWithTag("Player"); foreach (var foundObject in playerTagged) { switch (foundObject.name) { case "Player": playerScript = foundObject.GetComponent <PF_Player>(); break; case "Player Model": playerModel = foundObject; break; default: break; } } }
public int averageManaCost = 20; //Average price for mana ability, used to select shields #endregion #region Initialisation // Use this for initialization void Start() { //Getting script information attackList = GetComponent <BossAttacks>(); bossStats = GetComponent <Stats>(); playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PF_Player>(); //Adding initial past action pastBossActions.Add(BossActions.None); }
// Use this for initialization private void Start() { //find player GameObject[] playerTagged = GameObject.FindGameObjectsWithTag("Player"); foreach (var foundObject in playerTagged) { switch (foundObject.name) { case "Player": playerScript = foundObject.GetComponent <PF_Player>(); break; case "Player Model": playerModel = foundObject; break; default: break; } } }
private void Awake() { playerScript = GameObject.FindObjectOfType <PF_Player>(); }