Esempio n. 1
0
        // Start is called before the first frame update
        void Start()
        {
            gameEnd = false;
            //load the data from the peddle data
            attribute            = peddleAttribute.normal;
            length               = data.paddeLength;
            speed                = data.paddleSpeed;
            transform.localScale = new Vector3(0.5f, data.paddeLength, 0f);
            //using this to check the wrong data in the balldata.
            if (speed == 0 || length == 0)
            {
                Debug.Assert(speed != 0, "The paddle speed sould not be 0, you can change it in Asset/Data/PaddleData");
                Debug.Assert(length != 0, "The paddle length sould not be 0, you can change it in Asset/Data/PaddleData");
#if UnityEditor
                UnityEditor.EditorApplication.isPlaying = false;
#endif
            }
        }
Esempio n. 2
0
        private IEnumerator AttributeCoroutine(int attributeIndex)
        {
            yield return(new WaitForSeconds(5f));

            attribute &= ~(peddleAttribute)attributeIndex;
        }
Esempio n. 3
0
 //the function to change the attribut of the peddle for the skill system
 public void ChangeAttribute(int attributeIndex)
 {
     attribute |= (peddleAttribute)attributeIndex;
     StartCoroutine(AttributeCoroutine(attributeIndex));
 }