コード例 #1
0
 void UpdateCharacterState()
 {
     if ((Input.GetButtonDown("Fire1") == true) && (standByCharacters.Count > 0))
     {
         foreach (ThirdPersonUserControl controller in standByCharacters)
         {
             activeCharacters.Add(controller);
             controller.state = ThirdPersonUserControl.State.Active;
             controller.characterController.indicator = ThirdPersonCharacter.Indicator.Active;
         }
         standByCharacters.Clear();
     }
     else if ((Input.GetButtonDown("Fire2")) && (activeCharacters.Count > 1))
     {
         ThirdPersonUserControl currentController = activeCharacters[controlledIndex];
         foreach (ThirdPersonUserControl controller in activeCharacters)
         {
             if (controller != currentController)
             {
                 controller.state = ThirdPersonUserControl.State.Standby;
                 controller.characterController.indicator = ThirdPersonCharacter.Indicator.Standby;
             }
         }
         activeCharacters.Clear();
         activeCharacters.Add(currentController);
         controlledIndex = 0;
     }
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     GameManager.player = this.GetComponent <PlayerControl>();
     movement           = this.GetComponent <ThirdPersonUserControl>();
     codes       = new List <int>();
     currentLife = maxLife;
 }
コード例 #3
0
    // Use this for initialization
    public void StartATL(ThirdPersonUserControl player, CurvySpline spline)
    {
        /*
         * calling hull functions doesn't work
         * print ("start in ConcaveHullController called");
         * foreach (Transform child in transform)
         * {
         *      //can set vetices here
         *      ConcaveCollider newCollider = child.gameObject.AddComponent<ConcaveCollider>();
         *      newCollider.MaxHullVertices = maxHullVerts;
         *      newCollider.MaxHulls = maxHulls;
         *      newCollider.Precision = precision;
         *      newCollider.ForceNoMultithreading = true;
         *      newCollider.ComputeHulls (null, null);
         *      //child.GetComponent<ConcaveCollider> ().ComputeHulls (null, null);
         *      Destroy(child.transform.GetChild(0).gameObject);
         *      child.gameObject.AddComponent<MakeMesh> ();
         *      //print ("largest hull verts = " + child.GetComponent<ConcaveCollider> ().GetLargestHullVertices ());
         * }
         */

        foreach (Transform child in transform)
        {
            _childMeshes.Add(child.gameObject);
        }
    }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     if (id == 1)
     {
         dir [0] = -1;
         dir [1] = 0;
     }
     else
     {
         dir [0] = 1;
         dir [1] = 0;
     }
     personControl = GetComponent <ThirdPersonUserControl> ();
     personControl.setOnRunFinished(() => {
         ensureIsOnBoard();
         GameManager.Instance.changeTurn();
     });
     GameManager.Instance.setOnPlayerChangeListener(id, () => {
         int[] dim = defaultBlock();
         TileManager.Instance.selectBlock(dim[0], dim[1]);
     });
     GameManager.Instance.setOnLoseListener(id, () => {
         TileManager.Instance.disappear(current_x, current_y);
     });
 }
コード例 #5
0
 // Start is called before the first frame update
 void Start()
 {
     subject = GameObject.FindGameObjectWithTag("Player");
     code    = GameManager.instance;
     control = subject.GetComponent <ThirdPersonUserControl>();
     anim    = subject.GetComponent <Animator>();
 }
コード例 #6
0
    void Awake()
    {
        userControl = GetComponentInChildren <ThirdPersonUserControl>();
        animator    = GetComponentInChildren <Animator>();

        topRB = GetComponentInParent <Rigidbody>();
    }
コード例 #7
0
ファイル: CameraSwitch.cs プロジェクト: TobieD/City-Generator
    // Use this for initialization
    void Start()
    {
        if (FlyCamera == null || ThirdPersonCamera == null)
        {
            Debug.Log("No Camera found");
            return;;
        }

        _flyControl = FlyCamera.GetComponent<FlyCam>();
        if (_flyControl == null)
        {
            Debug.Log("No FlyCam script found on FlyCamera Gameobject");
            return;
        }

        _flyControl.isActive = true;
        FlyCamera.enabled = true;

        _thirdPersonControl = GameObject.FindWithTag("Player").GetComponent<ThirdPersonUserControl>();
        if (_thirdPersonControl == null)
        {
            Debug.Log("No ThirdPersonControl script found on ThirdPersonCamera Gameobject");
            return;
        }
        _thirdPersonControl.isActive = false;
        ThirdPersonCamera.enabled = false;
    }
コード例 #8
0
ファイル: planeController.cs プロジェクト: AnisaLl/UPx3-2-
 // Use this for initialization
 void Start()
 {
     //Isgameover = GameObject.FindGameObjectWithTag("plane").GetComponent<GameOver>();
     win = false;
     ThirdPersonUserControl_blue = GameObject.FindGameObjectWithTag("blue").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>();
     ThirdPersonUserControl_red = GameObject.FindGameObjectWithTag("red").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>();
     ThirdPersonUserControl_green = GameObject.FindGameObjectWithTag("green").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>();
     cameraController_camera = GameObject.Find("worldCenter").GetComponent<cameraController_camera>();
 }
コード例 #9
0
 void Start()
 {
     player_RigidBody = GetComponent <Rigidbody>();
     freezePositon();
     AssignToCamera();
     //get the ThirdPersonCharacter script component.
     tpControl = GetComponent <ThirdPersonUserControl>();
     tpc       = GetComponent <ThirdPersonCharacter>();
 }
コード例 #10
0
    // Update is called once per frame
    public void UpdateATL(ThirdPersonUserControl player_three, Crosshair crosshair, CurvySpline spline)
    {
        kickBackTime = Mathf.Clamp01(kickBackTime + Time.deltaTime * 2.0f);
        transform.localEulerAngles = new Vector3(kickBackCurve.Evaluate(kickBackTime) * -70, transform.localEulerAngles.y, transform.localEulerAngles.z);

        for (int i = 0; i < _missiles.Count; i++)
        {
            _missiles [i].UpdateATL(player_three, crosshair, spline);
        }
    }
コード例 #11
0
ファイル: AttackController.cs プロジェクト: ATL3Y/Ded_Game
    // Update is called once per frame
    public void UpdateATL(ThirdPersonUserControl _playerController_three)
    {
//		CurvySpline spline = splineLord_three.GetSpline ();
//
//		t = spline.GetNearestPointTF( _playerController_three.transform.position );
//
//		transform.position = spline.Interpolate ( t - spline.Length / 100.0f );
        transform.position = _playerController_three.transform.position - 15.0f * transform.forward + _lift;

        //transform.rotation = Quaternion.Slerp( transform.rotation, spline.GetOrientationFast( t ), Time.deltaTime * 5.0f );
    }
コード例 #12
0
ファイル: hasWin.cs プロジェクト: AnisaLl/UPx3-2-
 // Use this for initialization
 void Start()
 {
     winCanvas.enabled = false;
     win_mainmenu.enabled = false;
     Animacamera = GameObject.Find("AnimCamera_over");
     Debug.Log(Animacamera);
     anim = Animacamera.GetComponent<Animator>();
     ThirdPersonUserControl_blue = GameObject.FindGameObjectWithTag("blue").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>();
     ThirdPersonUserControl_red = GameObject.FindGameObjectWithTag("red").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>();
     ThirdPersonUserControl_green = GameObject.FindGameObjectWithTag("green").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>();
     Animacamera.SetActive(false);
 }
コード例 #13
0
    void Start()
    {
        carScript = car.GetComponent<CarMovement>();
        helicopterScript = helicopter.GetComponent<HelicopterScript> ();
        playerScript = player.GetComponent<ThirdPersonUserControl> ();
        cameraCarScript = mainCamera.GetComponent<CameraCarScript> ();
        cameraPlayerScript = mainCamera.GetComponent<CameraPlayerScript> ();
        cameraHelicopterScript = mainCamera.GetComponent<CameraHelicopterScript> ();

        player.transform.GetChild (0).GetChild(0).renderer.enabled = false;
        player.transform.GetChild (0).GetChild(1).renderer.enabled = false;
    }
コード例 #14
0
ファイル: SwitchPlayer.cs プロジェクト: surgeman/Rags-Reason
    /*void switchToPlayer(inputToEnable, inputToDisable, cameraLocation)
    {
        inputToEnable.enabled = true;
        inputToDisable.enabled = false;

        defaultCamera.transform.position = cameraLocation.transform.position;
        defaultCamera.transform.rotation = cameraLocation.transform.rotation;}*/
    // Use this for initialization
    void Start()
    {
        ragsUserControl = GameManager.god.ragsObject.GetComponent<ThirdPersonUserControl>();
           ragsAIControl = GameManager.god.ragsObject.GetComponent<AICharacterControl>();

           reasonUserControl = GameManager.god.reasonObject.GetComponent<BallUserControl>();
           reasonToRags = GameManager.god.reasonObject.GetComponent<FollowRags>();

           ragsPlayerCam = GameManager.god.ragsCam;
           reasonPlayerCam = GameManager.god.reasonCam;

           //ragsUserControl.enabled = playerRagsActive;
           //reasonUserControl.enabled = playerReasonActive;

           //ragsPlayerCam.enabled = playerRagsActive;
           //reasonPlayerCam.enabled = playerReasonActive;

        //player1Input = player1.GetComponent("(your controller)");
        //player2Input = player2.GetComponent("(your controller)");
    }
コード例 #15
0
    // Use this for initialization
    void Start()
    {
        targetAnimator.GetBehaviour<StateSoundBehaviour>().soundBank = targetAnimator.GetComponent<SoundBank>();

        radiusOfInteraction = GetComponent<Collider>().bounds.extents.x;
        thirdCharacter = GetComponent<ThirdPersonCharacter>();
        userControl = GetComponent<ThirdPersonUserControl>();
        animationRootOrigin = animationRoot.localPosition;
        animationRootOriginRot = animationRoot.localRotation;
        characterCollider = GetComponent<Collider>();
        characterRigidbody = GetComponent<Rigidbody>();

        start_rejuvination_time = rejuvination_time;
        start_flash_time = flash_time;
        fatigue_pool_start = fatigue_pool;
        mats[0] = Resources.Load<Material>("mainbody");
        mats[1] = Resources.Load<Material>("greenarms");
        mats[2] = Resources.Load<Material>("greencore");
        mats[3] = Resources.Load<Material>("greenlegs");
        mats[4] = Resources.Load<Material>("yellowarms");
        mats[5] = Resources.Load<Material>("yellowcore");
        mats[6] = Resources.Load<Material>("yellowlegs");
        mats[7] = Resources.Load<Material>("redarms");
        mats[8] = Resources.Load<Material>("redcore");
        mats[9] = Resources.Load<Material>("redlegs");
        skin = transform.FindChild("Mesh").transform.FindChild("anubis").transform.FindChild("polySurface63").GetComponent<SkinnedMeshRenderer>();
    }