Ejemplo n.º 1
0
 void Start()
 {
     pathvalue = GetComponent <AgentData>();
     Identify  = GetComponent <SphereCaster>();
     agent     = GetComponent <NavMeshAgent>();
     anim      = GetComponent <Animator>();
     enemy     = GetComponent <EnemyMovement>();
     Timer     = 20;
     InvokeRepeating("Idle", 1f, Random.Range(30f, 60f));
     test     = GameObject.FindWithTag("Connection").GetComponent <TestClientConnection>();
     thisRend = GetComponent <Renderer>();
 }
Ejemplo n.º 2
0
        private void Start()
        {
            OnGround = false;

            // 1 << gameObject.layer で自分と同一のレイヤー以外を無視、
            // ~でビットをすべて反転(?) つまり自分と同一のレイヤーのみ無視
            int layerMask = ~(1 << this.gameObject.layer);

            economizer   = new DetectionEconomizer();
            sphereCaster = new SphereCaster(layerMask);

            Debug.Log("<color=blue>" + "The gameObject GroundDetectorSphere is attached to is in  [" + LayerMask.LayerToName(this.gameObject.layer) + "]  layer." + "\n" + "And OnGroundDetector ignores this layer. " + "</color>");
        }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        simpleTouchControllerCam = GameObject.Find("/Canvas/SimpleTouch JoystickCam").GetComponent <SimpleTouchController>();
        Vector3 rot = transform.localRotation.eulerAngles;

        rotY = rot.y;
        rotX = rot.x;
        // wylacza widok kursora
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;

        blackStripes = (new GameObject("blackStripes")).AddComponent <BlackStripes>();
        mainCamera   = GameObject.Find("CameraHolder/Main Camera");
        Debug.Log(mainCamera.name + " = main camera name");

        cameraCollision = GameObject.Find("CameraHolder/Main Camera").GetComponent <CameraCollison>();
        sphereCaster    = GameObject.Find("CameraHolder/Main Camera").GetComponent <SphereCaster>();
    }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     AgentTarget = GetComponent <AgentMovement>();
     EnemyAgent  = GetComponent <NavMeshAgent>();
     Myeyes      = GetComponent <SphereCaster>();
 }
Ejemplo n.º 5
0
 void Start()
 {
     Position = GetComponent <SphereCaster>();
     hiveinfo = GetComponent <HiveInfo>();
 }