예제 #1
0
 // Start is called before the first frame update
 void Start()
 {
     planetBarName = planetBar.name;
     bar           = GameObject.Find(planetBarName).GetComponent <PlanetHealthBar>();
     player        = GameObject.Find("Player");
     hp            = player.GetComponent <Health>();
     powerups      = player.GetComponent <Powerups>();
     planetName    = gameObject.name;
 }
예제 #2
0
파일: Shield.cs 프로젝트: otterice/Solarius
 // Start is called before the first frame update
 void Start()
 {
     sr         = GetComponent <SpriteRenderer>();
     cC2D       = GetComponent <CircleCollider2D>();
     player     = GameObject.Find("Player");
     powerups   = player.GetComponent <Powerups>();
     sr.enabled = false;
     notDamaged = true;
 }
예제 #3
0
 void Start()
 {
     player    = GameObject.Find("Player");
     powerups  = player.GetComponent <Powerups>();
     speed     = GameObject.Find("Speed POW");
     triBullet = GameObject.Find("Tri POW");
     bigBullet = GameObject.Find("BigBullet POW");
     shield    = GameObject.Find("Shield POW");
 }
예제 #4
0
        // Start is called before the first frame update
        void Start()
        {
            //Gets player states
            p             = GetComponent <playerStates>();
            leftFace      = GameObject.Find("LeftFacing");
            rightFace     = GameObject.Find("RightFacing");
            p.lookingLeft = false;

            player   = GameObject.Find("Player");
            powerups = player.GetComponent <Powerups>();
        }
예제 #5
0
        void Start()
        {
            anim              = GetComponent <Animator>();
            powerups          = GameObject.Find("Player").GetComponent <Powerups>();
            finishedAnimation = false;

            int RNG = Random.Range(1, 5);

            //From the RNG, set the waypoints and the name of the planet
            if (RNG == 1 && !powerups.purplePlanetisDestroyed)
            {
                Wpoints    = GameObject.FindGameObjectWithTag("WayPointPurple").GetComponent <Waypoints>();
                planetName = "purplePlanet";
            }
            else if (RNG == 2 && !powerups.redPlanetisDestroyed)
            {
                Wpoints    = GameObject.FindGameObjectWithTag("WayPointRed").GetComponent <Waypoints>();
                planetName = "redPlanet";
            }
            else if (RNG == 3 && !powerups.earthisDestroyed)
            {
                Wpoints    = GameObject.FindGameObjectWithTag("WayPointEarth").GetComponent <Waypoints>();
                planetName = "earth";
            }
            else if (RNG == 4 && !powerups.orangePlanetisDestroyed)
            {
                Wpoints    = GameObject.FindGameObjectWithTag("WayPointOrange").GetComponent <Waypoints>();
                planetName = "orangePlanet";
            }
            else
            {
                Start();
            }

            planet = GameObject.Find(planetName);
            pHP    = planet.GetComponent <planetHealth>();
        }
예제 #6
0
 private void Start()
 {
     body     = GetComponent <Rigidbody2D>();
     player   = GameObject.Find("Player");
     powerups = player.GetComponent <Powerups>();
 }