Exemple #1
0
    void Start()
    {
        movementScript = this.GetComponent <Boss1Movement>();

        if (movementScript == null)
        {
            Debug.Log("No movement script attached to this Boss !");
            this.enabled = false;
        }

        platforms = new List <GameObject>();

        foreach (GameObject go in movementScript.gameObjects)
        {
            if (go != null)
            {
                platforms.Add(go);
            }
        }

        if (platforms.Count <= 1)
        {
            Debug.Log("The boss must have at least two platforms !");
            this.enabled = false;
        }

        rand          = new System.Random();
        cumulatedTime = switchTime;
    }
Exemple #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        Boss1Movement boss1 = (Boss1Movement)target;

        if (GUILayout.Button("Update position"))
        {
            boss1.setAngleDelta();
            boss1.updatePosition();
        }
    }
    //play the intro animation, assign scripts to variables


    void Start()
    {
        clip.Play();
        bs  = GetComponent <BossStats> ();
        bm  = GetComponent <Boss1Movement> ();
        eod = GetComponent <EffectOnDeath> ();
        gc  = GameObject.Find("Game Controller").GetComponent <GameController> ();

        //begin coroutines if the player is alive
        if (player = GameObject.FindGameObjectWithTag("Player"))
        {
            StartCoroutine(AimTurrets());
            StartCoroutine(BossAttacks());
            StartCoroutine(bm.Hover());
        }

        //initialise the health bar
        bs.health       = bs.maxHealth;
        healthBar       = GameObject.Find("Boss Health Bar").GetComponent <Slider>();
        healthBar.value = bs.health;
    }