示例#1
0
 void  OnConnectedToServer()
 {
     //	SpawnCubes();
     //Debug.Log("Connected to server");
     StartCoroutine(GetObjects());
     serverView.RPCEx("RespawnStuart", RPCMode.Server);
 }
示例#2
0
 void OnGUI()
 {
     if (GUILayout.Button("Call Print"))
     {
         otherView.RPCEx("PrintThis", RPCMode.All, "Hello World", "Not lol");
     }
 }
示例#3
0
    public void SetTarget(Vector3 clickedPosition)
    {
        targetObj.transform.position = clickedPosition;

        Vector3 targetVector = clickedPosition;

        serverView.RPCEx("SetStuartTarget", RPCMode.Server, targetVector.x, targetVector.y, targetVector.z);
    }
示例#4
0
    void Update()
    {
        if (isAlive)
        {
            if (isInEmc)
            {
                if (countDownBeforeDie > delayBeforeHide)
                {
                    if (!isSafe)
                    {
                        //stuart est mort
                        serverView.RPCEx("StuartDead", RPCMode.All);
                        isAlive = false;
                        Debug.Log("You'r dead, bitch");
                    }
                    else
                    {
                        //reset des variables
                        countDownBeforeDie = 0f;
                        isInEmc            = false;
                        isSafe             = true;
                        Debug.Log("Definitly safe");
                    }
                }

                //décrémente le temps
                countDownBeforeDie += Time.deltaTime;
            }


            GetCubesForce();
            if (!stopStuart)
            {
                WheelAngle();
            }
            else
            {
                StopStuart();
            }
        }
        else
        {
            stopStuart = true;
            StopStuart();
        }


        //debug stuff
        if (Input.GetMouseButtonUp(2))
        {
            targetObj.transform.position = this.transform.position;
        }
    }
示例#5
0
    public void CreateNewWave()
    {
        switch (interactiveMode)
        {
        case InteractiveMode.Repulsive:
            serverView.RPCEx("CreateWave", RPCMode.All, cubeId, (int)interactiveMode);
            Debug.Log("a");

            break;

        case InteractiveMode.Attractive:
            serverView.RPCEx("CreateWave", RPCMode.All, cubeId, (int)interactiveMode);
            Debug.Log("b");

            break;

        case InteractiveMode.Emc:
            Debug.Log("émojqhsfmoqshfg");
            serverView.RPCEx("CreateWave", RPCMode.All, cubeId, (int)interactiveMode);
            break;
        }
    }