예제 #1
0
    // Update is called once per frame
    void Update()
    {
        //Debug.Log((int)(1f / Time.unscaledDeltaTime));

        if (!initial_control_set)
        {
            initial_control_set = true;
            AssumeControl(controlled, controlled_handler);
        }

        if (!controlled_handler.PlayerCanCommand())
        {
            SwitchControl();

            if (!controlled_handler.PlayerCanCommand())
            {
                // defeat!
            }
        }

        game_camera_handler.FocusOn(controlled);

        controlled_handler.MakeFlashlightFacePoint(game_camera.ScreenToWorldPoint(Input.mousePosition));
    }
예제 #2
0
 public void SwitchControl()
 {
     if (brother_handler.UnderPlayerCommand())
     {
         if (sister_handler.PlayerCanCommand())
         {
             brother_handler.PlayerLeaveControl();
             AssumeControl(sister, sister_handler);
         }
     }
     else
     {
         if (brother_handler.PlayerCanCommand())
         {
             sister_handler.PlayerLeaveControl();
             AssumeControl(brother, brother_handler);
         }
     }
 }