Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        // Correct init logics

        if (GetComponent <CoinSpin>() != null)
        {
            coin = GetComponent <CoinSpin>();
        }

        if (GetComponent <AudioSource>() != null)
        {
            //Audi = GetComponent<AudioSource>();
        }
        this.tag         = Globals.TAGS.Item;
        this.award_Flame = Mathf.Max(award_Flame, 0f);
        if (monitor == null)
        {
            monitor = Session_Monitor.Instance;
            Audi    = ((AudioSource )monitor.gameObject.GetComponent <AudioSource>());
        }
        if (dragonSM == null)
        {
            dragonSM = FindObjectsOfType <HealthMonitor>().First(t => t.tag == Globals.TAGS.Player);
        }
        Audi = ((AudioSource)monitor.gameObject.GetComponent <AudioSource>());
        if (GetComponent <CoinSpin>() == null)
        {
            Audi = null;
        }
        p = FindObjectOfType <Perks>();
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     if (mon == null)
     {
         mon = Session_Monitor.Instance;
     }
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     if (mon == null)
     {
         mon = Session_Monitor.Instance;
     }
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown("escape"))
     {
         Ses.End();
     }
     if (Input.GetKeyDown(KeyCode.Space))
     {
         Ses.End();
     }
     //t.text = "Hp: " + HP + "\nStamina: " + Stamina + "\nFuel:" + Flame;
     if (HP <= 0)
     {
         Session_Monitor s = FindObjectOfType <Session_Monitor>();
         s.End();
     }
     if (Stamina <= 0)
     {
         if (wait <= 0)
         {
             Session_Monitor s = FindObjectOfType <Session_Monitor>();
             s.End();
         }
         wait -= Time.deltaTime;
     }
     hurtByGroundRate -= Time.deltaTime;
 }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        Session_Monitor session = FindObjectOfType <Session_Monitor>();

        skinSelected = session.getSkins();
        wingSelected = session.getWings();
        var skin = (GameObject)Instantiate(skins[skinSelected], gameObject.transform.position, gameObject.transform.rotation);
        var wing = (GameObject)Instantiate(wings[wingSelected], gameObject.transform.position, gameObject.transform.rotation);

        skin.transform.parent = gameObject.transform;
        wing.transform.parent = gameObject.transform;
    }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        Ses = Session_Monitor.Instance;
        {
            // If the starting HP is not set, set as total
            // So people dont die RIGHT at start
            this.HP += this.MaxHP;

            if (Collison == null)
            {
                Collison = GetComponent <Collider2D>();
            }
            if (RBody == null)
            {
                RBody = GetComponent <Rigidbody2D>();
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        forceHeld = false;

        /*Data temp = GameObject.FindGameObjectWithTag("Load").GetComponent<Data>();
         * if (temp != null)
         * {
         *  selected = temp.get().breathSelected;
         *  Debug.Log(selected);
         * }*/
        session  = FindObjectOfType <Session_Monitor>();
        selected = session.getBreaths();
        Debug.Log(selected);
        breath    = objects[selected].GetComponent <AttackBase>();
        timer     = breath.rate;
        xScale    = transform.lossyScale.x / 2;
        p         = gameObject.GetComponentInParent <Perks>();
        soundTime = 5.0f;
    }
Esempio n. 8
0
    // Use this for initialization
    void Start()
    {
        // Correct init logics

        if (GetComponent<CoinSpin>() != null)
        {
            coin = GetComponent<CoinSpin>();
        }

        if (GetComponent<AudioSource>() != null)
        {
            //Audi = GetComponent<AudioSource>();
        }
        this.tag = Globals.TAGS.Item;
        this.award_Flame = Mathf.Max(award_Flame, 0f);
        if (monitor == null)
        {
            monitor = Session_Monitor.Instance;
            Audi = ((AudioSource )monitor.gameObject.GetComponent<AudioSource>());
        }
        if (dragonSM == null)
        {
            dragonSM = FindObjectsOfType<HealthMonitor>().First(t => t.tag == Globals.TAGS.Player);
        }
        Audi = ((AudioSource)monitor.gameObject.GetComponent<AudioSource>());
        if(GetComponent<CoinSpin>() == null)
        {
            Audi = null;
        }
        p = FindObjectOfType<Perks>();
    }
Esempio n. 9
0
 // Use this for initialization
 void Start()
 {
     this.monitor = FindObjectOfType <Session_Monitor>();
 }
Esempio n. 10
0
 // Use this for initialization
 void Start()
 {
     this.monitor = FindObjectOfType<Session_Monitor>();
 }
Esempio n. 11
0
    bool halfFlightCost;        //256
    // Use this for initialization
    void Start()
    {
        Session_Monitor session  = FindObjectOfType <Session_Monitor>();
        int             selected = session.getPerks();

        Debug.Log(selected);
        int temp;

        if (selected >= selectedcombo.Length)
        {
            Random.seed = System.DateTime.Now.Millisecond;
            temp        = Random.Range(0, 511);
        }
        else
        {
            temp = selectedcombo[selected];
        }

        if (temp - 256 >= 0)
        {
            halfFlightCost = true;
            temp          -= 256;
        }
        else
        {
            halfFlightCost = false;
        }
        if (temp - 128 >= 0)
        {
            improvedResistance = true;
            temp -= 128;
        }
        else
        {
            improvedResistance = false;
        }
        if (temp - 64 >= 0)
        {
            resitance = true;
            temp     -= 64;
        }
        else
        {
            resitance = false;
        }
        if (temp - 32 >= 0)
        {
            halfBreathCost = true;
            temp          -= 32;
        }
        else
        {
            halfBreathCost = false;
        }
        if (temp - 16 >= 0)
        {
            halfDamage = true;
            temp      -= 16;
        }
        else
        {
            halfDamage = false;
        }
        if (temp - 8 >= 0)
        {
            doublePrincessWorth = true;
            temp -= 8;
        }
        else
        {
            doublePrincessWorth = false;
        }
        if (temp - 4 >= 0)
        {
            BarnyardExplosion = true;
            temp -= 4;
        }
        else
        {
            BarnyardExplosion = false;
        }
        if (temp - 2 >= 0)
        {
            tripleGold = true;
            temp      -= 2;
        }
        else
        {
            tripleGold = false;
        }
        if (temp - 1 >= 0)
        {
            doubleGold = true;
        }
        else
        {
            doubleGold = false;
        }
    }