Inheritance: MonoBehaviour
コード例 #1
0
    // Use this for initialization
    void Start()
    {
        // initially true
        sleeping = true;

        anim = GetComponent<Animator>();
        personSight = GetComponent<PersonSight>();
    }
コード例 #2
0
 // initialize variables with awake function
 void Awake()
 {
     touchObject = this.transform.FindChild("SenseTouch").gameObject;
     suspicion = GetComponent<Suspicion>();
     personSight = GetComponent<PersonSight>();
     woken = touchObject.GetComponent<Woken>();
     nav = GetComponent<NavMeshAgent>();
     InitialiseSantaTransform();
     gameController = GetComponent<GameController>();
 }
コード例 #3
0
 // Use this for initialization
 void Awake()
 {
     suspicion = GetComponent<Suspicion>();
     personSight = GetComponent<PersonSight>();
     nav = GetComponent<NavMeshAgent>();
     santa = GameObject.FindGameObjectWithTag("Player").transform;
     startingPosition = transform.position;
     touchObject = this.transform.FindChild("SenseTouch").gameObject;
     woken = touchObject.GetComponent<Woken>();
 }
コード例 #4
0
    // Use this for initialization
    void Awake()
    {
        // Setting up the reference
        sittingScript = GetComponent<SittingScript>();
        personSight = GetComponent<PersonSight>();
        suspicion = GetComponent<Suspicion>();
        nav = GetComponent<NavMeshAgent>();
        santa = GameObject.FindGameObjectWithTag("Player").transform;
        originalFOV = personSight.fieldOfViewAngle;

        touchObject = this.transform.FindChild("SenseTouch").gameObject;
        woken = touchObject.GetComponent<Woken>();
    }
コード例 #5
0
    IEnumerator Start()
    {
        //InvokeRepeating("CastRays", 0, updateRate);
        personSight = GetComponent<PersonSight>();
        collider = GetComponent<SphereCollider>();

        yOffset = personSight.GetRayPos1();

        // Collide with everything except layer 2
        layerMask = 1 << 2;
        // invert
        layerMask = ~layerMask;
        yield return StartCoroutine("WaitAndPrint");
    }
コード例 #6
0
    // Use this for initialization
    void Awake()
    {
        // Setting up the reference
        sleepingScript = GetComponent<SleepingScript>();
        personSight = GetComponent<PersonSight>();
        suspicion = GetComponent<Suspicion>();
        nav = GetComponent<NavMeshAgent>();
        santa = GameObject.FindGameObjectWithTag("Player").transform;
        fovEyesScript = GetComponent<FOV2DEyes>();
        fovConeScript = GetComponent<FOV2DVisionCone>();

        touchObject = this.transform.FindChild("SenseTouch").gameObject;
        woken = touchObject.GetComponent<Woken>();
    }
コード例 #7
0
    void Awake()
    {
        InitialiseSantaTransform();
        personSight = GetComponent<PersonSight>();
        suspicion = GetComponent<Suspicion>();
        nav = GetComponent<NavMeshAgent>();
        anim = GetComponent<Animator>();

        touchObject = this.transform.FindChild("SenseTouch").gameObject;
        woken = touchObject.GetComponent<Woken>();

        // Must make sure rotation of person is by the animator and not by the nav mesh agent
        nav.updateRotation = false;
        animSetup = new AnimatorSetup(anim);

        // Convert deadZone variable from degrees to radians
        deadZone *= Mathf.Deg2Rad;
    }