示例#1
0
 protected void Mute()
 {
     stopTalking          = true;
     stringBuilder.Length = 0;
     stringBuilder.AppendFormat("{0} is being muted.", MyName);
     ThingConsole.LogWarning(stringBuilder.ToString());
 }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        float hour = sky.Cycle.Hour;

        if (hour > 19f && hour < 19.2f && !sunsetReported)
        {
            print("------Sunset------");
            if (OnSunset != null)
            {
                OnSunset();
            }
            ThingConsole.LogWarning("Sunset");
            sunsetReported = true;
            IsDay          = false;
            IsNight        = true;
            Invoke("ResetSunsetReportFlag", reportCoolDown);
        }

        if (hour > 7f && hour < 7.2f && !sunriseReported)
        {
            print("------Sunrise------");
            if (OnSunrise != null)
            {
                OnSunrise();
            }
            ThingConsole.LogWarning("Sunrise");
            IsDay           = true;
            IsNight         = false;
            sunriseReported = true;
            Invoke("ResetSunriseReportFlag", reportCoolDown);
        }
    }
示例#3
0
    private void Start()
    {
        //neighbor detector
        neighborDetector           = GetComponent <SphereCollider> ();
        neighborDetector.isTrigger = true;

        //motor
        motor = GetComponent <ThingMotor> ();
        motor.SetAccel(settings.acceleration);
        motor.rb.drag = settings.drag;
        motor.rb.mass = settings.mass;
        motor.FacingTarget(settings.alwaysFacingTarget);

        //Instantiating Particle Object
        explodePS = GetComponentInChildren <ParticleSystem> ();
        if (explodePS == null)
        {
            stringBuilder.Length = 0;
            stringBuilder.AppendFormat("{0} doesn't have a particle system?!", MyName);
            ThingConsole.LogWarning(stringBuilder.ToString());
        }

        //Sound
        audioSource              = gameObject.GetComponent <AudioSource> ();
        audioSource.rolloffMode  = AudioRolloffMode.Linear;
        audioSource.spatialBlend = 1f;
        audioSource.maxDistance  = 50;

        TTTStart();
    }
示例#4
0
 private void RescueFromWater()
 {
     if (InWater)
     {
         ResetPosition();
         ThingConsole.LogWarning(FormatString("{0} is rescued from water", MyName));
     }
 }
示例#5
0
 private void RescueFromWater()
 {
     if (InWater)
     {
         ResetPosition();
         stringBuilder.Length = 0;
         stringBuilder.AppendFormat("{0} is rescued from water", MyName);
         ThingConsole.LogWarning(stringBuilder.ToString());
     }
 }
示例#6
0
    private void Start()
    {
        //neighbor detector
        // neighborDetector = GetComponent<SphereCollider> ();
        // neighborDetector.isTrigger = true;
        //no longer use sphere collider as neighbor detector
        if (GetComponent <SphereCollider>())
        {
            Destroy(GetComponent <SphereCollider>());
        }

        //motor
        motor = GetComponent <ThingMotor>();
        motor.SetAccel(settings.acceleration * 4);
        motor.rb.drag = settings.drag;
        motor.rb.mass = settings.mass;
        motor.FacingTarget(settings.alwaysFacingTarget);

        //Instantiating Particle Object
        explodePS = GetComponentInChildren <ParticleSystem>();
        if (explodePS == null)
        {
            ThingConsole.LogWarning(FormatString("{0} doesn't have a particle system?!", MyName));
        }

        //Sound
        audioSource                       = gameObject.GetComponent <AudioSource>();
        audioSource.playOnAwake           = false;
        audioSource.loop                  = false;
        audioSource.bypassListenerEffects = false;
        audioSource.spatialBlend          = 1f;
        audioSource.maxDistance           = 35;
        audioSource.dopplerLevel          = 5;

        //material
        var renderers = gameObject.GetComponentsInChildren <MeshRenderer>();

        foreach (var rend in renderers)
        {
            rend.material = ColorManager.instance.GetMaterial(1f, Random.Range(0f, 1f) > 0.6f ? true : false);
        }

        TTTStart();

        speakCD.GoCooldown();
    }
示例#7
0
    // Update is called once per frame
    void Update()
    {
        float hour = sky.Cycle.Hour;

        if (hour > 19f && hour < 19.2f && !sunsetReported)
        {
            print("------Sunset------");
            if (OnSunset != null)
            {
                OnSunset();
            }
            ThingConsole.LogWarning("Sunset");
            sunsetReported = true;
            IsDay          = false;
            IsNight        = true;
            Invoke("ResetSunsetReportFlag", reportCoolDown);
        }

        if (hour > 7f && hour < 7.2f && !sunriseReported)
        {
            print("------Sunrise------");
            if (OnSunrise != null)
            {
                OnSunrise();
            }
            ThingConsole.LogWarning("Sunrise");
            IsDay           = true;
            IsNight         = false;
            sunriseReported = true;
            Invoke("ResetSunriseReportFlag", reportCoolDown);
        }

        stringBuilder.Length = 0;
        stringBuilder.AppendFormat("\n\n{0}", sky.Cycle.DateTime.TimeOfDay.ToString());
        timeText.text = stringBuilder.ToString();
    }
示例#8
0
 protected void Mute()
 {
     stopTalking = true;
     ThingConsole.LogWarning(FormatString("{0} is being muted.", MyName));
 }
示例#9
0
 protected void DeMute()
 {
     stopTalking = false;
     ThingConsole.LogWarning(gameObject.name + "can speak again.");
 }
示例#10
0
 protected void Mute()
 {
     stopTalking = true;
     ThingConsole.LogWarning(gameObject.name + "is being muted");
 }