Exemple #1
0
        void Start()
        {
            _jesusDelegate = GameObject.Find("Jesus").GetComponent <Jesus>();

            _focusMarker        = transform.Find("focus marker").gameObject;
            _armAnimation       = GetComponent <Animation>()["elf arm work 2"];
            _armAnimation.speed = Random.Range(0.0f, 1.0f);
            _focusMarker.gameObject.SetActive(false);

            _lastTimeStep = Time.time;

            _rigidbody = transform.GetComponent <Rigidbody>();

            GetComponent <AudioSource>().clip = hammerSoundArray[Random.Range(0, hammerSoundArray.Length)];

            _giftFactory         = GameObject.Find("Gift Factory").GetComponent <GiftFactory>();
            _bloodAndGoreFactory = GameObject.Find("Blood And Gore Factory").GetComponent <BloodAndGoreFactory>();
            numHammerHits        = 0;

            // for turning the Elf to color.black when he's on fire
            torsoRenderer = transform.Find("torso").GetComponent <Renderer>();
//			Debug.Log("torsoRenderer = " + torsoRenderer);
            legLeftRenderer   = transform.Find("leg - left").GetComponent <Renderer>();
            legRightRenderer  = transform.Find("leg - right").GetComponent <Renderer>();
            armLeftRenderer   = transform.Find("arm - left").GetComponent <Renderer>();
            armRightRenderer  = transform.Find("Arm Right Joint/arm - right").GetComponent <Renderer>();
            handLeftRenderer  = transform.Find("hand - left").GetComponent <Renderer>();
            handRightRenderer = transform.Find("Arm Right Joint/hand - right").GetComponent <Renderer>();
            headRenderer      = transform.Find("head joint/head").GetComponent <Renderer>();
            hatRenderer       = transform.Find("head joint/elf hat").GetComponent <Renderer>();
            noseRenderer      = transform.Find("head joint/nose").GetComponent <Renderer>();
            hatBrimRenderer   = transform.Find("head joint/brim").GetComponent <Renderer>();
            hatBallRenderer   = transform.Find("head joint/ball").GetComponent <Renderer>();

            // The direction the Elf is looking when game starts.
            // He looks this direction any time when he can't see Jesus.
            HeadJoint = transform.Find("head joint");
            //Debug.Log("head joint = " + HeadJoint);
            originalDirection = HeadJoint.rotation;
//			JesusLookTarget = GameObject.Find("Jesus/Jesus Parts Container/eye - left").transform;
            SantaLookTarget = GameObject.Find("Characters/Santa (1)/Santa/santa look target").transform;

            s_canAcknowledge = true;
            s_canBePushed    = true;

            _acknowledgeSoundThreshold = 0.5f;
            _pushedSoundTreshold       = 1.2f;
            _underGazeTime             = Mathf.Infinity;
        }
Exemple #2
0
        void Start()
        {
            _jesusDelegate = GameObject.Find("Jesus").GetComponent<Jesus>();

            _focusMarker = transform.Find("focus marker").gameObject;
            _armAnimation = GetComponent<Animation>()["elf arm work 2"];
            _armAnimation.speed = Random.Range(0.0f,1.0f);
            _focusMarker.gameObject.SetActive(false);

            _lastTimeStep = Time.time;

            _rigidbody = transform.GetComponent<Rigidbody>();

            GetComponent<AudioSource>().clip = hammerSoundArray[Random.Range(0,hammerSoundArray.Length)];

            _giftFactory = GameObject.Find("Gift Factory").GetComponent<GiftFactory>();
            _bloodAndGoreFactory = GameObject.Find("Blood And Gore Factory").GetComponent<BloodAndGoreFactory>();
            numHammerHits = 0;

            // for turning the Elf to color.black when he's on fire
            torsoRenderer = transform.Find("torso").GetComponent<Renderer>();
            //			Debug.Log("torsoRenderer = " + torsoRenderer);
            legLeftRenderer = transform.Find("leg - left").GetComponent<Renderer>();
            legRightRenderer = transform.Find("leg - right").GetComponent<Renderer>();
            armLeftRenderer = transform.Find("arm - left").GetComponent<Renderer>();
            armRightRenderer = transform.Find("Arm Right Joint/arm - right").GetComponent<Renderer>();
            handLeftRenderer = transform.Find("hand - left").GetComponent<Renderer>();
            handRightRenderer = transform.Find("Arm Right Joint/hand - right").GetComponent<Renderer>();
            headRenderer = transform.Find("head joint/head").GetComponent<Renderer>();
            hatRenderer = transform.Find("head joint/elf hat").GetComponent<Renderer>();
            noseRenderer = transform.Find("head joint/nose").GetComponent<Renderer>();
            hatBrimRenderer = transform.Find("head joint/brim").GetComponent<Renderer>();
            hatBallRenderer = transform.Find("head joint/ball").GetComponent<Renderer>();

            // The direction the Elf is looking when game starts.
            // He looks this direction any time when he can't see Jesus.
            HeadJoint = transform.Find("head joint");
            //Debug.Log("head joint = " + HeadJoint);
            originalDirection = HeadJoint.rotation;
            //			JesusLookTarget = GameObject.Find("Jesus/Jesus Parts Container/eye - left").transform;
            SantaLookTarget = GameObject.Find("Characters/Santa (1)/Santa/santa look target").transform;

            s_canAcknowledge = true;
            s_canBePushed = true;

            _acknowledgeSoundThreshold = 0.5f;
            _pushedSoundTreshold = 1.2f;
            _underGazeTime = Mathf.Infinity;
        }