// Use this for initialization
 void Awake()
 {
     //This allows this object to be the only object in existance
     if (rune == null)
     {
         rune = this;
     }
     else if (rune != this)
     {
         Destroy(gameObject);
     }
 }
示例#2
0
 void Start()
 {
     rb2d = GetComponent <Rigidbody2D>();                  //reference rb2d
     staffLightningPoint = GetComponent <BoxCollider2D>(); //reference box collider
     anim            = staff.GetComponent <Animator>();    //reference animator
     moveLocation    = 0;                                  //Default 0
     strikePoint     = 0;                                  //Default 0
     hDirection      = 0;                                  //Default 0, 1 is right, -1 is left
     strikeBounds    = 0;                                  //Default 0
     strikeState     = false;
     pS              = playerStats.stats;
     RuneScriptSpeed = RuneScriptSpeed.rune;
     runeMultiplyer  = pS.runeMultiplyerSpeed;
     sound           = GetComponent <AudioSource>();
 }
示例#3
0
    void Start()
    {
        playerLevel     = 1;
        playerExp       = 0f;
        playerSpeedStat = 1f;
        RuneScriptSpeed = RuneScriptSpeed.rune;
        coins           = 5;
        lives           = 3;


        //Speed Rune Stats
        runeCoolDownSpeed   = 10;
        runeDurationSpeed   = 2;
        runeUnlockSpeed     = true;
        runeMultiplyerSpeed = 5;

        //Rain Rune Stats
        runeCoolDownRain = 10;
        runeDurationRain = 2;
        runeUnlockRain   = true;

        //Wind Rune Stats
        runeCoolDownWind = 10;
        runeDurationWind = 2;
        runeUnlockWind   = true;

        //Time Rune Stats
        runeCoolDownTime = 10;
        runeDurationTime = 2;
        runeUnlockTime   = true;

        //Inv Rune Stats
        runeCoolDownInv = 10;
        runeDurationInv = 10;
        runeUnlockInv   = true;
    }