コード例 #1
0
    void Start()
    {
        //	PlayerPrefs.DeleteKey("tutorial");

        this.slowJump = true;
        // Se o tutorial ja estiver completo
        if (SaveSystem.loadString("tutorial") == "tutorial")
        {
            jump = GameObject.Find("JumpTutorial");
            Destroy(jump);
            Destroy(prefabsJump.GetComponent <ActiveJumpDinoTutorial>());
            Destroy(gameObject);
        }

        else
        {
            // Get Components
            touch     = GameObject.Find("DirTouch").GetComponent <TouchRight>();
            touchLeft = GameObject.Find("EsqTouch").GetComponent <TouchLeft>();
            jump      = GameObject.Find("JumpTutorial");
            jump.SetActive(false);
        }
    }
コード例 #2
0
ファイル: Actor.cs プロジェクト: ernads93/vrue_task4
    // Use this for initialization
    void Start()
    {
        //hierarchyObjects = GameObject.FindGameObjectWithTag("Respawn");

        if (isServer || isLocalPlayer)
        {
            if (isLocalPlayer)
            {
                // Inform the local player about his new character
                var localSingleton = LocalPlayerController.Singleton;
                // if (localSingleton != null)
                {
                    localSingleton.SetActor(this);
                    CmdInitialize(prefabName);
                    wantsAuthority = false;
                }
            }

            //this part is for object sharing
            //*******************************
            // actually both want the list of distributed items
            GameObject[] obs = GameObject.FindGameObjectsWithTag("shared");
            sharedObjects = new List <NetworkIdentity>();

            foreach (GameObject o in obs)
            {
                sharedObjects.Add(o.GetComponent <NetworkIdentity>());
                //  NetworkServer.Spawn(o);
            }

            if (isServer)
            {
                // find objects that can be manipulated
                // TIPP : you can use a specific tag for all GO's that can be manipulated by players
            }
            if (isLocalPlayer)
            {
                // find objects that can be manipulated
                // assign this Actor to the localActor field of the AuthorityManager component of each shared object
                if (obs == null)
                {
                    obs = GameObject.FindGameObjectsWithTag("shared");
                }
                {
                    foreach (GameObject o in obs)
                    {
                        o.GetComponent <AuthorityManager>().AssignActor(this);
                    }
                }

                var timerObj = GameObject.FindGameObjectWithTag("Timer");
                timerText  = timerObj.GetComponentInChildren <Text>();
                timer      = timerObj.GetComponentInChildren <Timer>();
                pointsText = GameObject.FindGameObjectWithTag("Points").GetComponentInChildren <Text>();
            }
            //*******************************
        }
        else
        {
            // Initialize on startup
            Initialize(prefabName);
        }
        playerTag = GameObject.FindGameObjectWithTag("Player");

        // include inactive children, as the capsule hands are only set active
        // if Leap rexognizes your hands
        tr = playerTag.GetComponentInChildren <TouchRight>(true);
        tl = playerTag.GetComponentInChildren <TouchLeft>(true);
        //createObjects = gameObject.GetComponentInChildren<CreateManipObj>();
    }
コード例 #3
0
 public virtual void OnTouchLeft()
 {
     TouchLeft.Invoke(this);
 }
コード例 #4
0
ファイル: Widget.cs プロジェクト: randomcrab/Myra
 public virtual void OnTouchLeft()
 {
     IsTouchInside = false;
     TouchLeft.Invoke(this);
 }
コード例 #5
0
    /* Lorsqu'on appuie à GAUCHE de l'écran, le joueur peut :
     * - si un ennemi est là		SAUTER
     * - si aucun ennemi n'est là	SAUTER | VOLER
     */
    private void PlayerActionLeft(TouchLeft touch)
    {
        if (!activateTouch)
            return;

        if (!IsFlying ())
            JumpController ();
        else {
            if (wantToFly)
                return;

            wantToFly = true;

            flyingTouchId = touch.leftId;
            flyingTouchPosition = touch.leftTouchPosition;
        }
    }
コード例 #6
0
 void Start()
 {
     this.interfaceJumba = GetComponent <InterfaceJumba>();
     right = GameObject.Find("DirTouch").GetComponent <TouchRight>();
     left  = GameObject.Find("EsqTouch").GetComponent <TouchLeft>();
 }