Example #1
0
    public static moodEdge getMoods()
    {
        if (moods == null)
        {
            moods = GameObject.FindObjectOfType <moodEdge>();
        }

        return(moods);
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (moods == null)
        {
            moods = this;
        }

        heartbeat = (moods.GetComponent <Image>().color != neutral);
        if (heartbeat)
        {
            Color init = GetComponent <Image>().color;

            float pulseUpper = pulseMax;

            init.a = Mathf.Lerp(pulseMin, pulseUpper, t);
            GetComponent <Image>().color = init;

            if (!waning)
            {
                t += pulseTime * Time.deltaTime;
                if (t > 1.0f)
                {
                    waning = true;
                }
            }
            else
            {
                t -= pulseTime * Time.deltaTime;
                if (t < 0f)
                {
                    waning = false;
                }
            }

            // if (t < 0)
            //    MoodSwitch(moods.neutral);
        }
    }
Example #3
0
    void Start()
    {
        moods = this;

        GetComponent <Image>().color = neutral;
    }
Example #4
0
 void Awake()
 {
     moods = this;
 }