예제 #1
0
    // Start is called before the first frame update
    private void Start()
    {
        normalMask       = 17;
        invulnerableMask = 24;

        gm       = GameManager.Get();
        rig      = GetComponent <Rigidbody>();
        torque   = GetComponent <TorqueLookRotation>();
        outline  = GetComponent <Outline>();
        animator = GetComponentInChildren <Animator>();

        radius.OnRadiusFindEnemy   += StartEscape;
        Enemy.OnDeath              += CheckEnemySpotted;
        OnFairyDeath               += ForceStartEscape;
        GameManager.OnLevelEndWave += EndEscape;

        currentState     = initialState;
        selectedWaypoint = initialWaypoint;

        SwitchRotationTarget();
        currentColor         = normalColor;
        outline.OutlineColor = currentColor;
        gm.currentFairies++;
        animator.speed = Random.Range(0.8f, 1.4f);


        if (OnFairySpawn != null)
        {
            OnFairySpawn();
        }
    }
예제 #2
0
    // Start is called before the first frame update
    private void Start()
    {
        npcDistance   = 99;
        deathLayer    = 24;
        rig           = GetComponent <Rigidbody>();
        torque        = GetComponent <TorqueLookRotation>();
        outline       = GetComponent <Outline>();
        enemyCollider = GetComponent <Collider>();

        radius.OnRadiusFindAlly += StartPursuit;

        currentState     = initialState;
        selectedWaypoint = initialWaypoint;

        SwitchRotationTarget();

        finalSpeed             = speed;
        originalDistanceToStop = distanceToStop;
        finalDistanceToStop    = originalDistanceToStop;
        GameManager.Get().enemies.Add(gameObject);
        deathTimer = -1;
        deathTime  = 1;

        animator.SetBool("IsWalking", true);
        animator.SetBool("IsEating", false);
        deathParticle.SetActive(false);
    }
예제 #3
0
파일: Flock.cs 프로젝트: frankvega2010/Fee
 // Start is called before the first frame update
 void Start()
 {
     isAlone        = false;
     goalPos        = FlockManager.goalPosition;
     rig            = GetComponent <Rigidbody>();
     torque         = GetComponent <TorqueLookRotation>();
     torque.enabled = true;
 }
예제 #4
0
 // Start is called before the first frame update
 void Start()
 {
     rig                = GetComponent <Rigidbody>();
     gm                 = GameManager.Get();
     torque             = GetComponent <TorqueLookRotation>();
     torque.target      = target.transform;
     transform.position = startPosition;
 }