Example #1
0
    IEnumerator BlinkingScarf(KinematicTestController controller, float blinkFrequency, Color initialColor)
    {
        //Debug.Log("I started and can take dmg = " + controller.GetJustTookDamage());
        bool isInitialColor = true;
        //Color initialColor = ZoeScarfMat.color;
        //forshow2 = initialColor;
        float frequencyToSeconds = 1 / blinkFrequency;

        //yield return new WaitForEndOfFrame();
        Debug.Log("Am i invulnerable? = " + isInvulnerable);
        while (isInvulnerable)
        {
            yield return(new WaitForSeconds(frequencyToSeconds));

            if (isInitialColor)
            {
                Debug.Log("Invul color");
                //ZoeScarfMat.color = invulnerableColor;
                SetZoeScarfColor(invulnerableColor, ZoeScarfMat, ZoeScarfParticlesMat);
                isInitialColor = !isInitialColor;
            }
            else
            {
                Debug.Log("base color");
                //ZoeScarfMat.color = initialColor;
                SetZoeScarfColor(initialColor, ZoeScarfMat, ZoeScarfParticlesMat);
                isInitialColor = !isInitialColor;
            }
        }
        SetZoeScarfColor(initialColor, ZoeScarfMat, ZoeScarfParticlesMat);
    }
Example #2
0
 private void Start()
 {
     //Cursor.lockState = CursorLockMode.Locked;
     if (Character == null)
     {
         Character = FindObjectOfType <KinematicTestController>();
     }
     inputManager = GetComponent <InputManager>();
 }
Example #3
0
    IEnumerator UpdateInvulrenableTime(KinematicTestController controller)
    {
        isInvulnerable = true;
        float iFrameDuration = controller.GetIFrameMaxDuration();

        Debug.Log("iFrameDuration = " + iFrameDuration);

        while (iFrameDuration > 0)
        {
            iFrameDuration -= Time.deltaTime;
            yield return(new WaitForSeconds(0f));
        }
        isInvulnerable = false;
    }
Example #4
0
    private void Start()
    {
        callOnce = true;
        isSceneLoadTransition = false;
        transitionFader.SetAlpha(1);

        waitForloadNextScene  = sceneLoadFadeTime.getValue();
        timerForLoadNextScene = 0;

        if (playerMovementController == null)
        {
            playerMovementController = FindObjectOfType <KinematicTestController>();
        }
        if (playerStats == null)
        {
            playerStats = FindObjectOfType <LivePlayerStats>();
        }
    }
Example #5
0
 private void Awake()
 {
     isInvulnerable = false;
     //Debug.Log("I started and can take dmg = " + zoeController.GetCanTakeDamage());
     if (ZoeScarfMat != null)
     {
         SetZoeScarfColor(baseScarfColor, ZoeScarfMat, ZoeScarfParticlesMat);
     }
     else
     {
         Debug.LogError("No ZoeScarfMat was assigned on " + gameObject.name + " in ZoeScarfColor");
     }
     if (zoeController == null)
     {
         Debug.LogError("No Zoe Controller was assigned in " + gameObject.name + " in ZoeScarfColor");
         zoeController = new KinematicTestController();
     }
 }