private void Awake() { // Auto Get Components mainGun = new DuelGun(spawnPoint, bulletPrefab, bulletFolder); mainBody = GetComponent <Rigidbody2D>(); animControl = GetComponent <AnimationControl2D>(); }
// Start is called before the first frame update void Start() { // Auto-Get from the same GameObject rb2D = GetComponent <Rigidbody2D>(); pSnap = GetComponent <PositionSnap>(); animControl = GetComponent <AnimationControl2D>(); // Set Start Animation animControl.ChangeState("WalkRight"); }
private void Start() { positions = new List <Vector2>(); positions.Add(firstPos); positions.Add(endPos); if (!animControl) { animControl = GetComponent <AnimationControl2D>(); } }
void Start() { // Set current static reference current = this; // Set Timer eggTimer = new Timer(eggTimerValue); eggTimer.OnComplete += SpawnEgg; stunTimer = new Timer(1f); stunTimer.OnComplete += EndStun; // Set Score currentPickScore = maxScore; // Auto-Get from the same GameObject rb2D = GetComponent <Rigidbody2D>(); animControl = GetComponent <AnimationControl2D>(); }