/// <summary> /// Initialises the variables. /// </summary> /// <param name="targetBall">Target ball.</param> /// <param name="beeSpeed">Bee speed.</param> public override void InitialiseVariables(GameObject targetBall, float beeSpeed, int beeValue, Object particleResource, Object ScoreNumResource, Vector3 HiveTragetPos, BeeMScript BeeMananager) { numberOfHit = 5; hasBall = false; answerBall = targetBall; isAttacking = true; speed = beeSpeed; value = beeValue; /*if(value == 2) * { * GetComponent<SpriteRenderer>().color = Color.cyan; * } * else if(value == 3) * { * GetComponent<SpriteRenderer>().color = Color.magenta; * }//*/ BeeHivePos = HiveTragetPos; particlePrefab = particleResource; ScoreNumberPrefab = ScoreNumResource; BeeM = BeeMananager; if (targetBall.transform.position.x > transform.position.x) { //transform.localScale = new Vector3(-1,1,1); transform.Rotate(Vector3.up, 180f); } //*/ QBParent = transform.parent; healthBar = QBParent.GetChild(1).GetChild(2).gameObject; subtractor = healthBar.transform.localScale.x / numberOfHit; StartCoroutine(ATTACK_ON_TITAN()); }
/// <summary> /// Initialises the variables used by the bee to begin all actions. /// </summary> /// <param name="targetBall">the correct answer ball, grabbed by the claw, so the bee can follow it and check when it has touched it.</param> /// <param name="beeSpeed">the movement speed of the bee.</param> /// <param name="beeValue">the value of the bee to be taken from the answer ball or added when clicked upon.</param> /// <param name="particleResource">the prefab of the bee burst particle.</param> /// <param name="ScoreNumResource">the prefab of the score modifier particle.</param> /// <param name="HiveTragetPos">the world space location of the hive.</param> /// <param name="BeeMananager">the bee manager, should be the only one. aka 'this'.</param> public virtual void InitialiseVariables(GameObject targetBall, float beeSpeed, int beeValue, Object particleResource, Object ScoreNumResource, Vector3 HiveTragetPos, BeeMScript BeeMananager) { answerBall = targetBall; isAttacking = true; speed = beeSpeed; value = beeValue; /*if(value == 2) * { * GetComponent<SpriteRenderer>().color = Color.cyan; * } * else if(value == 3) * { * GetComponent<SpriteRenderer>().color = Color.magenta; * }//*/ BeeHivePos = HiveTragetPos; particlePrefab = particleResource; ScoreNumberPrefab = ScoreNumResource; BeeM = BeeMananager; if (targetBall.transform.position.x > transform.position.x) { //transform.localScale = new Vector3(-1,1,1); transform.Rotate(Vector3.up, 180f); } //*/ StartCoroutine(ATTACK_ON_TITAN()); }
//public bool isCollected; // Use this for initialization void Start() { ScoreManager_Script = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreManagerScript>(); SM_Script = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManagerScript>(); GM_1Script = GameObject.FindGameObjectWithTag("GM").GetComponent <GM_1>(); BeeM_Script = GameObject.FindGameObjectWithTag("BeeM").GetComponent <BeeMScript>(); Claw_Script = GameObject.FindGameObjectWithTag("Claw").GetComponent <ClawScript>(); QueenAnimation = this.GetComponent <Animator> (); }
/// <summary> /// Initialises the variables used by the bee to begin all actions. /// </summary> /// <param name="beeSpeed">the movement speed of the bee.</param> /// <param name="beeValue">the answer the bee carries in an int based format.</param> /// <param name="particleResource">the prefab of the bee burst particle.</param> /// <param name="ScoreNumResource">the prefab of the score modifier particle.</param> /// <param name="BeeMananager">the bee manager, should be the only one. aka 'this'.</param> /// <param name="CarryBallMat">the appropriate answer ball material.</param> public void InitialiseVariables(float beeSpeed, int beeValue, Object particleResource, Object ScoreNumResource, BeeMScript BeeMananager, Material CarryBallMat) { CarryBall = transform.GetChild(0).gameObject; moveSpeed = beeSpeed; value = beeValue; particlePrefab = particleResource; scoreNumberPrefab = ScoreNumResource; BeeM = BeeMananager; CarryBall.GetComponent <MeshRenderer>().material = CarryBallMat; Invoke("Kill", 5f); StartCoroutine(Movement()); }
private void Start() { BeeManager = GameObject.FindGameObjectWithTag("BeeM") ? GameObject.FindGameObjectWithTag("BeeM").GetComponent <BeeMScript>() : null; }