// Use this for initialization void Start () { rend = GetComponent<Renderer>(); rend.enabled = false; monster = GameObject.FindObjectOfType<spt_monsterMovement>(); if (isFlashlight) data = new spt_flashlightClass(angerNum, rend); else data = new spt_baseAngerClass(angerNum, rend); // toggles the visibility of objects on an interval (for testing purposes) InvokeRepeating("toggleVisibility", visibleToggleInterval, visibleToggleInterval); // Performs the "per-tick" calculations needed on actions with a duration (like the flashlight). InvokeRepeating("incrementTimer", data.getDuration(), data.getDuration()); }
// Use this for initialization void Start() { if (isFlashlight) data = new spt_flashlightClass(angerNum); else if (isDurationObject) data = new spt_durationAngerClass(angerNum); else data = new spt_baseAngerClass(angerNum); monster = GameObject.FindObjectOfType<spt_monsterMotivation>(); // Performs the "per-tick" calculations needed on actions with a duration (like the flashlight). InvokeRepeating("incrementTimer", data.getDuration(), data.getDuration()); }