示例#1
0
 private void Awake()
 {
     // Auto Get Components
     mainGun     = new DuelGun(spawnPoint, bulletPrefab, bulletFolder);
     mainBody    = GetComponent <Rigidbody2D>();
     animControl = GetComponent <AnimationControl2D>();
 }
示例#2
0
        // 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");
        }
示例#3
0
文件: Npc.cs 项目: ToxicMask/Gamecine
 private void Start()
 {
     positions = new List <Vector2>();
     positions.Add(firstPos);
     positions.Add(endPos);
     if (!animControl)
     {
         animControl = GetComponent <AnimationControl2D>();
     }
 }
示例#4
0
        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>();
        }