コード例 #1
0
ファイル: decreaseSmell.cs プロジェクト: jeff7424/FYP_main
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     script = player.GetComponentInChildren<ringOfSmell>();
 }
コード例 #2
0
    void Start()
    {
        //Physics.gravity = new Vector3(0.0f, -grav, 0.0f);

        //boneCoolDown.GetComponent<Animator>().enabled = false;
        //bagCoolDown.GetComponent<Animator>().enabled = false;

        //bagCoolDown.enabled = false;
        boneSpawnTimer = defaultBoneSpawnTimer;
        m_GroundCheckDistance = 0.6f;
        rb = GetComponent<Rigidbody>();
        catAnim = GetComponent<Animator>();
        origMovementSpeed = movementSpeed;
        sprintSpeed = movementSpeed * sprintModifier;
        ring = GetComponentInChildren<ringOfSmell>();
        boneSpawner = GameObject.FindGameObjectWithTag("BoneSpawner");
        durationOfSpriteAnimationBone = spriteAnimationBone.length;
        durationOfSpriteAnimationBag = spriteAnimationBag.length;
        isEsc = !isEsc;
        //mainCam = Camera.main;

        //numberOfBones = GetComponent<Text>().text--;
    }
コード例 #3
0
ファイル: smellArea.cs プロジェクト: jeff7424/FYP_main
 void Start()
 {
     checkInArea = GameObject.Find ("ring of Smell").GetComponent<ringOfSmell>();
 }
コード例 #4
0
ファイル: fatDogAi.cs プロジェクト: jeff7424/FYP_main
    void Start()
    {
        coneOfVisionScript = GetComponentInChildren<coneOfVision>();
        dogRigidbody = GetComponent<Rigidbody>();
        agent = GetComponent<NavMeshAgent> ();
        player = GameObject.FindGameObjectWithTag("Player");
        ringOfSmellScript = player.GetComponentInChildren<ringOfSmell>();

        raycastRange = GetComponentInChildren<coneOfVision>().startRange; //defaultRaycastRange;
        turnTimerAlert = defaultTurnTimerAlert;
        //respawnPosition = this.transform.position;

        setDirectionsForIdle();
        setTargetWaypoints();

        currentTarget = targets[0];
        lastTarget = currentTarget;
        agent.speed = patrolSpeed;
        agent.SetDestination(currentTarget.position);
        stateManager((int)enumStatesFatDog.idle);

        //Setting Timers
        timer = defaultTimer;
        eatTimer = defaultEatTimer;
        idleTimer = defaultIdleTimer;
        barkTimer = defaultBarkTimer;
        escapeTimer = defaultEscapeTimer;
        turnTimer = defaultTurnTimer;

        x = transform.right.x * 1.0f;
        y = transform.right.z * 1.0f;
        startingAngle = Mathf.Atan2(x, y) * Mathf.Rad2Deg;
        startingVector = transform.forward * 2.0f;
        respawnPosition = transform.position;

        newSphere = (GameObject)Instantiate(sphere, this.transform.position, Quaternion.identity);
        newSphere.transform.parent = transform;
        newSphere.SetActive (false);
    }
コード例 #5
0
ファイル: enemyPathfinding.cs プロジェクト: jeff7424/FYP_main
    //end of Misc variables
    void Start()
    {
        respawnPosition = this.transform.position;
        dodgeTimer = defaultDodgeTimer;
        visionRotator = GameObject.FindGameObjectWithTag("VisionRotator");
        player = GameObject.FindGameObjectWithTag("Player");
        ringOfSmellScript = player.GetComponentInChildren<ringOfSmell>();
        coneOfVisionScript = GetComponentInChildren<coneOfVision>();
        patrolAnim = gameObject.GetComponent<Animator>();

        //Setting waypoints and Navigation Mesh agent
        setDirectionsForIdle();
        setTargetWaypoints();
        currentTarget = targets[0];
        lastTarget = currentTarget;
        firstTarget = currentTarget;
        agent = GetComponent<NavMeshAgent>();
        agent.speed = patrolSpeed;
        agent.SetDestination(currentTarget.position);
        //end of Setting waypoints and Navigation Mesh agent

        //Setting Timers
        chargeTimer = defaultChargeTimer;
        timer = defaultTimer;
        eatTimer = defaultEatTimer;
        barkTimer = defaultBarkTimer;
        alertTimer = defaultAlertTimer;
        escapeTimer = defaultEscapeTimer;
        turnTimer = defaultTurnTimer;
        turnTowardsSmellTimer = defaultTurnTowardsSmellTimer;
        agentNotMovingTimer = defaultAgentNotMovingTimer;
        newTargetTimer = defaultNewTargetTimer;
        //end of Setting Timers

        //Misc
        playerCollider = player.GetComponent<Collider>();
        rb = GetComponent<Rigidbody> ();
        //end of Misc
    }
コード例 #6
0
    //private checkPoint cp;
    void Start()
    {
        isHiding = false;
        isPaused = false;
        isEntered = false;

        //cp = character.GetComponent<checkPoint>();
        ros = character.FindChild ("Smell ring FBX").GetComponent<ringOfSmell>();
        playerScript = character.GetComponent<TemporaryMovement>();
        characterCamera = playerScript.mainCam.GetComponent<thirdPersonCamera> ();
        //cameraPosition.localRotation = Quaternion.Euler(0, transform.parent.eulerAngles.y, 0);
        //Debug.Log (cameraPosition.eulerAngles.y);
        showHiding.SetActive(false);
    }
コード例 #7
0
ファイル: hatPowers.cs プロジェクト: jeff7424/FYP_main
 // Use this for initialization
 void Start()
 {
     disguiseTimer = defaultDisguiseTimer;
     hiddenSmellTimer = defaultHiddenSmellTimer;
     ring = GetComponentInChildren<ringOfSmell>();
 }