Esempio n. 1
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();
    }
Esempio n. 2
0
    private void Start()
    {
        //neighbor detector
        neighborDetector           = GetComponent <SphereCollider>();
        neighborDetector.isTrigger = true;

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

        //Chat Ballon
        chatBalloon   = gameObject.GetComponentInChildren <ChatBalloon>();
        speakCDLength = Random.Range(8f, 13f);

        //Instantiating Particle Object
        explodePS = GetComponentInChildren <ParticleSystem>();

        //Sound
        audioSource = gameObject.GetComponent <AudioSource>();
        audioSource.spatialBlend = 0.9f;
        audioSource.maxDistance  = 35;

        //color
        rend = GetComponent <Renderer>();
        if (rend == null)
        {
            rend = GetComponentInChildren <Renderer>();
        }
        originalColor = rend.material.color;

        TTTStart();
    }
Esempio n. 3
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();
    }
Esempio n. 4
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);

        //Chat Ballon

        speakCDLength = Random.Range(8f, 13f);

        //Instantiating Particle Object
        explodePS = GetComponentInChildren <ParticleSystem> ();
        if (explodePS == null)
        {
            Debug.LogError(gameObject.name + " doesn't have a particle system!!!!!!!!!");
        }

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

        //color
        rend = GetComponent <Renderer> ();
        if (rend == null)
        {
            rend = GetComponentInChildren <Renderer> ();
        }
        originalColor = rend.material.color;

        TTTStart();
    }