Beispiel #1
0
    //Main-Initialisation
    private void Start()
    {
        vignetteFlash = GameObject.FindGameObjectWithTag("vFlash").GetComponent <VignetteFlash>();
        //Get the rigidBody Component
        rigidBody            = GetComponent <Rigidbody>();
        rigidBody.useGravity = false;

        powerCore = GameObject.FindGameObjectWithTag("Base_System").GetComponent <Base_System>();

        targetLocationToHit = GameObject.FindGameObjectWithTag("ShipHitLocation");

        //FIND OBJECTS BY TAGS?
        event_Spawner = this.transform.parent.GetComponent <Event_Spawner>();

        switch (event_Spawner.currentEventDirection)
        {
        case Event_.EventDirection.TOP:
            shield_System = GameObject.Find("Shield - Top").transform.GetChild(0).GetComponent <Shield_System>();

            weapon_System = GameObject.FindGameObjectWithTag("wTOP").GetComponent <Weapon_System>();
            //weapon_System = GameObject.Find("Weapon - Top").transform.GetChild(0).GetComponent<Weapon_System>();
            //Debug.Log("Found the top Shield component");
            break;

        case Event_.EventDirection.LEFT:
            shield_System = GameObject.Find("Shield - Left").transform.GetChild(0).GetComponent <Shield_System>();

            weapon_System = GameObject.FindGameObjectWithTag("wLEFT").GetComponent <Weapon_System>();
            //weapon_System = GameObject.Find("Weapon - Left").transform.GetChild(0).GetComponent<Weapon_System>();
            //Debug.Log("Found the left Shield component");
            break;

        case Event_.EventDirection.RIGHT:
            shield_System = GameObject.Find("Shield - Right").transform.GetChild(0).GetComponent <Shield_System>();

            weapon_System = GameObject.FindGameObjectWithTag("wRIGHT").GetComponent <Weapon_System>();
            //weapon_System = GameObject.Find("Weapon - Right").transform.GetChild(0).GetComponent<Weapon_System>();
            //Debug.Log("Found the right Shield component");
            break;

        case Event_.EventDirection.BOTTOM:
            shield_System = GameObject.Find("Shield - Bottom").transform.GetChild(0).GetComponent <Shield_System>();

            weapon_System = GameObject.FindGameObjectWithTag("wBOTTOM").GetComponent <Weapon_System>();
            //weapon_System = GameObject.Find("Weapon - Bottom").transform.GetChild(0).GetComponent<Weapon_System>();
            //Debug.Log("Found the bottom Shield component");
            break;

        default:
            break;
        }
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        isArrow    = false;
        bombActive = false;
        god_Mode   = false;
        is_Froze   = false;

        rb               = GetComponent <Rigidbody>();
        HPManager        = GetComponent <Killable>();
        animationManager = GetComponent <AnimationManager>();
        weapon           = GetComponent <Weapon_System>();
        inventory        = GetComponent <Inventory>();
    }