Example #1
0
    //public GameObject TransitionCam;

    void Start()
    {
        HUDcharacter = characterImage.GetComponent <Animator>();



        if (!isInitialized)
        {
            GameObject gameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

            if (gameInstancer != null)
            {
                instance = gameInstancer.GetComponent <scr_GameInstance> ();
            }

            instance.LoadUserProfile();
            GetComponent <scr_PowerUpMethods>().FindMethod(ref powerupAction, instance.UserProfile.playerEngine.CodeName, ref HUDcharacter);
            HUDcharacter.Play("idle");

            GameObject user = Instantiate(instance.ShipObjects.Find(obj => obj.name == instance.UserProfile.playerShip.ShipName), spawnPoint);
            Debug.Log("Thiis guy is" + user.tag);
            player = user.GetComponent <scr_playerBehaviour> ();
            ChangeStats();
            player.stats.difficulty = player.stats.Difficulty();
            powerupAction("Start", player);
            leaveSpeed = player.stats.speed / 2;

            Initialize();
            isInitialized = true;
        }
        enabled = false;
    }
Example #2
0
    void FindPlayer()
    {
        GameObject playerControllerObj = GameObject.FindWithTag("Player");

        if (playerControllerObj != null)
        {
            player = playerControllerObj.GetComponent <scr_playerBehaviour>();
        }
        if (player == null)
        {
            Debug.Log("Cannot Find 'PlayerController' Script");
        }
    }
Example #3
0
 // Use this for initialization
 void Start()
 {
     FindGC();
     player = this.GetComponentInParent <scr_playerBehaviour>();
 }