// Start is called before the first frame update void Start() { myRigidBody2D = GetComponent <Rigidbody2D>(); timeWizard = FindObjectOfType <TimeWizard>(); movementSpeed = timeWizard.GetRobotSpeed(); animator = GetComponent <Animator>(); }
private void Start() { myRigidBody2D = GetComponent <Rigidbody2D>(); timeWizard = FindObjectOfType <TimeWizard>(); turret = GetComponentInParent <Turret>(); bulletSpeed = timeWizard.GetEnemyBulletSpeed() * turret.GetDirectionOfShoot(); //the speed of the laser = the main Time script * direction }
// Start is called before the first frame update void Start() { feet = GetComponent <BoxCollider2D>(); body = GetComponent <CapsuleCollider2D>(); health = GetComponent <Health>(); myRigidBody2D = GetComponent <Rigidbody2D>(); timeWizard = FindObjectOfType <TimeWizard>(); movementSpeed = timeWizard.GetRobotSpeed(); animator = GetComponent <Animator>(); }
void Awake() { if (i == null) { i = this; } else { throw new Exception("There can only be 1 TimeWizard in the scene!"); } }
// Start is called before the first frame update void Start() { transform.position = Checkpoint; //we need the origin location (will change on different checkpoints gameSession = FindObjectOfType <GameSession>(); //Game Session timeSliderSript = FindObjectOfType <TimeSlider>(); //Time slider rigidbody2d = GetComponent <Rigidbody2D>(); //RigidBody animator = GetComponent <Animator>(); //Animator Feet = GetComponent <CapsuleCollider2D>(); //bottom collision part body = GetComponent <BoxCollider2D>(); //top collision part timeWizard = FindObjectOfType <TimeWizard>(); //the main TIME Script health = GetComponent <Health>(); //the Health }