Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     EM        = GameObject.Find("GameManagement").GetComponent <EnemyManage>();
     time      = MaxTime;
     velocity  = Direction.normalized * Speed;
     mAudioSrc = GetComponent <AudioSource>();
     mAudioSrc.Play();
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     acceleration = InitialAcceleration;
     EM           = GameObject.Find("GameManagement").GetComponent <EnemyManage>();
     velocity     = Direction.normalized * Speed;
     mAudioSrc    = GetComponent <AudioSource>();
     mAudioSrc.Play();
     //startTime = 1.0f;
 }
Example #3
0
    private void InitManager()
    {
        uiMng    = new UIManager(this);
        DgMapMng = new DungenMapManager(this);
        EnMng    = new EnemyManage(this);

        uiMng.OnInit();
        DgMapMng.OnInit();
        EnMng.OnInit();
    }
    void OnEnable()
    {
        path           = GameObject.Find("Path").GetComponent <PathCreator>().path;
        segmentIndex   = 0;
        PositionOffset = Random.insideUnitCircle * Random.Range(-OffsetAmount, OffsetAmount);

        RecomputeSegment();
        transform.position = A;

        EM = GameObject.Find("GameManagement").GetComponent <EnemyManage>();
        // Debug.Log(path.GetPointsInSegment(0));
    }
Example #5
0
    //private readonly float EPSILON = 1e-4f;

    // TODO: health and show health bar
    // TODO: collision with the attack and reduce the health, collision to the endpoint.

    // Start is called before the first frame update
    void OnEnable()
    {
        isAvailable = true;

        health       = MaxHealth;
        healthBarObj = gameObject.transform.Find("HealthBar");
        healthBar    = healthBarObj.GetComponent <HealthBar>();
        healthBarObj.gameObject.SetActive(false);

        GM = GameObject.Find("GameManagement").GetComponent <GameManagement>();
        EM = GameObject.Find("GameManagement").GetComponent <EnemyManage>();
    }
Example #6
0
    // Start is called before the first frame update
    void Start()
    {
        EM = GameObject.Find("GameManagement").GetComponent <EnemyManage>();

        enemyTags = Enemies.Select(e => e.tag).ToList();
    }