예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        /* length = characterPrefabs.Length;
         * characterShow = new GameObject[length];
         *
         * for (int i = 0; i < length; i++)
         * {
         *  characterShow[i] = (GameObject)Instantiate(characterPrefabs[i], transform.position, transform.rotation);
         * }
         *
         * UpdateCharacterShow(); */
        baseCamera = mainCamera.transform.position;
        if (slot_id != CharaMenuHandler.DEFAULT_SLOT)
        {
            infos = new PlayerInfos(CharaMenuHandler.GetNextAvailableControl(null), slot_id);

            if (slot_id == 0)
            {
                playerObject = Instantiate(GameTime.GetRedModel(), transform.position, transform.rotation);
                playerObject.GetComponent <Player>().InstantiateMenu(infos);
                infos.GetModelInfos().SetModelToModelParameters(playerObject);
            }
            else if (slot_id == 1)
            {
                playerObject = Instantiate(GameTime.GetBlueModel(), transform.position, transform.rotation);
                playerObject.GetComponent <Player>().InstantiateMenu(infos);
                infos.GetModelInfos().SetModelToModelParameters(playerObject);
            }
            CharaMenuHandler.AddCharaSelect(this);
            if (display != null)
            {
                display.Display(infos.GetControls());
            }
        }
    }
예제 #2
0
 public void SetSlot(int slot_id)
 {
     infos        = new PlayerInfos(CharaMenuHandler.GetNextAvailableControl(null), slot_id);
     this.slot_id = slot_id;
     if (slot_id == 2)
     {
         playerObject = Instantiate(GameTime.GetRedModel(), transform.position, transform.rotation);
         playerObject.GetComponent <Player>().InstantiateMenu(infos);
         infos.GetModelInfos().SetModelToModelParameters(playerObject);
     }
     else if (slot_id == 3)
     {
         playerObject = Instantiate(GameTime.GetBlueModel(), transform.position, transform.rotation);
         playerObject.GetComponent <Player>().InstantiateMenu(infos);
         infos.GetModelInfos().SetModelToModelParameters(playerObject);
     }
     CharaMenuHandler.AddCharaSelect(this);
     display.Display(infos.GetControls());
 }
예제 #3
0
파일: Player.cs 프로젝트: Iilun/IC06
 public void Instantiate(PlayerInfos infos, float z_offset)
 {
     controls = infos.GetControls();
     if (infos.GetBoatId() == GameTime.BLUE_BOAT_ID)
     {
         boat = GameTime.GetBlueBoat();
     }
     else
     {
         boat = GameTime.GetRedBoat();
     }
     this.gameObject.transform.position = boat.gameObject.transform.position + new Vector3(0, 5, z_offset);
     infos.GetModelInfos().SetModelToModelParameters(this.gameObject);
 }
예제 #4
0
파일: Player.cs 프로젝트: Iilun/IC06
 public void InstantiateMenu(PlayerInfos infos)
 {
     controls = new PlayerControls('V', "VoidAxis", "VoidAxis", "VoidKey", "VoidKey", PlayerControls.VIDE);
     if (infos.GetBoatId() == GameTime.BLUE_BOAT_ID)
     {
         boat = GameTime.GetBlueBoat();
     }
     else
     {
         boat = GameTime.GetRedBoat();
     }
     infos.GetModelInfos().SetModelToModelParameters(this.gameObject);
     SetIsInteracting(true);
     transform.localScale = new Vector3(3, 3, 3);
     gameObject.GetComponent <Rigidbody>().isKinematic = true;
 }
예제 #5
0
파일: Player.cs 프로젝트: Iilun/IC06
 public void InstantiateCeleb(PlayerInfos infos, bool front, float x_offset)
 {
     GetMAnimator();
     controls = infos.GetControls();
     if (front)
     {
         boat = WinnerTime.GetFront();
         this.HasWon(x_offset >= 0 ? 1 : 0);
     }
     else
     {
         boat = WinnerTime.GetBack();
         this.HasLost(x_offset >= 0 ? 1 : 0);
     }
     this.gameObject.transform.position = boat.gameObject.transform.position + new Vector3(x_offset, 0, 0);
     infos.GetModelInfos().SetModelToModelParameters(this.gameObject);
     SetIsInteracting(true);
     transform.localScale = new Vector3(3, 3, 3);
     gameObject.GetComponent <Rigidbody>().isKinematic = true;
 }
예제 #6
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Keypad9))
        {
            player1Infos.GetModelInfos().ChangeCouvreChef(true);
            player1Infos.GetModelInfos().SetModelToModelParameters(playerObject);
        }
        if (Input.GetKeyDown(KeyCode.Keypad8))
        {
            player1Infos.GetModelInfos().ChangeBarbe(false);
            player1Infos.GetModelInfos().SetModelToModelParameters(playerObject);
        }
        if (Input.GetKeyDown(KeyCode.Keypad7))
        {
            player1Infos.GetModelInfos().ChangeManteau(true);
            player1Infos.GetModelInfos().SetModelToModelParameters(playerObject);
        }
        if (Input.GetKeyDown(KeyCode.Keypad6))
        {
            player1Infos.GetModelInfos().ChangeJambes(false);
            player1Infos.GetModelInfos().SetModelToModelParameters(playerObject);
        }
        if (Input.GetKeyDown(KeyCode.Keypad5))
        {
            player1Infos.GetModelInfos().ChangeMains(false);
            player1Infos.GetModelInfos().SetModelToModelParameters(playerObject);
        }
        if (Input.GetKeyDown(KeyCode.Keypad4))
        {
            player1Infos.GetModelInfos().ChangeOeil(false);
            player1Infos.GetModelInfos().SetModelToModelParameters(playerObject);
        }

        if (Input.GetKeyDown(KeyCode.KeypadEnter))
        {
            GameObject yolo = Instantiate(GameTime.GetRedModel(), new Vector3(0, 100, 0), Quaternion.identity);
            yolo.GetComponent <Player>().Instantiate(player1Infos, 0);
        }
    }