Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        rb = GetComponent <Rigidbody>();
        fp = GetComponent <FpcontrollerCs>();

        isholding = false;

        if (GameObject.Find("LevelManager") != null)
        {
            day = GameObject.Find("LevelManager").GetComponent <LevelManagerCs>();
        }
        else
        {
            day = null;
        }
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        day               = GameObject.FindObjectOfType <LevelManagerCs>();
        steer             = this.gameObject.AddComponent <MySteeringBehaviour>();
        agent.autoBraking = false;
        if (!string.IsNullOrEmpty(nameA))
        {
            pathToFollowA = GameObject.Find(nameA).GetComponentsInChildren <Transform>();
        }
        if (!string.IsNullOrEmpty(nameB))
        {
            pathToFollowB = GameObject.Find(nameB).GetComponentsInChildren <Transform>();
        }

        agent.autoBraking = false;
        isPathA           = true;
        isPathB           = false;
        //myAnimator = GetComponent<AiAnimator>();
    }
Exemplo n.º 3
0
 void Start()
 {
     if (!myAnim)
     {
         myAnim = GetComponent <Animator>();
     }
     level         = GameObject.Find("LevelManager").GetComponent <LevelManagerCs>();
     startPos      = transform.position;
     startRot      = camera.transform.rotation;
     rb            = GetComponent <Rigidbody>();
     forwardInput  = straffeInput = 0;
     isPlaying     = false;
     canCrouch     = true;
     forwardVel    = walkVel;
     myCollider    = GetComponent <CapsuleCollider>();
     canMove       = true;
     canPush       = false;
     stamina       = 100;
     staminaUifill = stamina / 100;
     canRun        = true;
     aud           = GetComponent <AudioSource>();
     isHolding     = false;
 }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     lv = Object.FindObjectOfType <LevelManagerCs>();
     NpcText.SetActive(false);
     thingToEnable.SetActive(false);
 }