Inheritance: MonoBehaviour
コード例 #1
0
ファイル: InventoryManager.cs プロジェクト: zepa19/MineBattle
    private void SurvivalInventoryToolbarLeftClick()
    {
        if (CopyOfItem == null)
        {
            if (Player.PStatus.ToolBox9[ButtonID].BlockID != 0)
            {
                CopyOfItem = Player.PStatus.ToolBox9[ButtonID];
                Player.PStatus.ToolBox9[ButtonID] = new BlockItem();
            }
        }
        else
        {
            if (Player.PStatus.ToolBox9[ButtonID].BlockID != 0)
            {
                BlockItem tmp = Player.PStatus.ToolBox9[ButtonID];
                Player.PStatus.ToolBox9[ButtonID] = CopyOfItem;
                CopyOfItem = tmp;
            }
            else
            {
                Player.PStatus.ToolBox9[ButtonID] = CopyOfItem;
                CopyOfItem = null;
            }
        }

        PlayerGUI.UpdateToolbar();
        SetTextTemp2();
    }
コード例 #2
0
ファイル: InventoryManager.cs プロジェクト: zepa19/MineBattle
    private void CraftingTableINLeftClick()
    {
        if (CopyOfItem == null)
        {
            if (GameManager._Instance.CraftTableData.B[ButtonID].BlockID != 0)
            {
                CopyOfItem = GameManager._Instance.CraftTableData.B[ButtonID];
                GameManager._Instance.CraftTableData.B[ButtonID] = new BlockItem();
            }
        }
        else
        {
            if (GameManager._Instance.CraftTableData.B[ButtonID].BlockID != 0)
            {
                BlockItem tmp = GameManager._Instance.CraftTableData.B[ButtonID];
                GameManager._Instance.CraftTableData.B[ButtonID] = CopyOfItem;
                CopyOfItem = tmp;
            }
            else
            {
                GameManager._Instance.CraftTableData.B[ButtonID] = CopyOfItem;
                CopyOfItem = null;
            }
        }

        PlayerCrafting.DoCrafting(false);
        PlayerGUI.UpdateCraftingTable();
        SetTextTemp3();
    }
コード例 #3
0
ファイル: InventoryManager.cs プロジェクト: zepa19/MineBattle
    private void CraftingInventoryLeftClick()
    {
        if (CopyOfItem == null)
        {
            if (Player.PStatus.SurvivalInv[ButtonID].BlockID != 0)
            {
                CopyOfItem = Player.PStatus.SurvivalInv[ButtonID];
                Player.PStatus.SurvivalInv[ButtonID] = new BlockItem();
            }
        }
        else
        {
            if (Player.PStatus.SurvivalInv[ButtonID].BlockID != 0)
            {
                BlockItem tmp = Player.PStatus.SurvivalInv[ButtonID];
                Player.PStatus.SurvivalInv[ButtonID] = CopyOfItem;
                CopyOfItem = tmp;
            }
            else
            {
                Player.PStatus.SurvivalInv[ButtonID] = CopyOfItem;
                CopyOfItem = null;
            }
        }

        PlayerGUI.UpdateCraftingInv();
        SetTextTemp3();
    }
コード例 #4
0
ファイル: InventoryManager.cs プロジェクト: zepa19/MineBattle
    private void MiniCraftingTableINLeftClick()
    {
        if (CopyOfItem == null)
        {
            if (GameManager._Instance.MCTGameObjs.B[ButtonID].BlockID != 0)
            {
                CopyOfItem = GameManager._Instance.MCTGameObjs.B[ButtonID];
                GameManager._Instance.MCTGameObjs.B[ButtonID] = new BlockItem();
            }
        }
        else
        {
            if (GameManager._Instance.MCTGameObjs.B[ButtonID].BlockID != 0)
            {
                BlockItem tmp = GameManager._Instance.MCTGameObjs.B[ButtonID];
                GameManager._Instance.MCTGameObjs.B[ButtonID] = CopyOfItem;
                CopyOfItem = tmp;
            }
            else
            {
                GameManager._Instance.MCTGameObjs.B[ButtonID] = CopyOfItem;
                CopyOfItem = null;
            }
        }

        PlayerMiniCrafting.DoMiniCrafting(false);
        PlayerGUI.UpdateMiniCraftingTable();
        SetTextTemp2();
    }
コード例 #5
0
    public void SpawnPlayer(int classIndex, int teamIndex, string playerName, GameObject source)
    {
        NetworkConnection connection    = source.GetComponent <NetworkBehaviour>().connectionToClient;
        Transform         startPosition = GetStartPosition();
        GameObject        newPlayer     = Instantiate(classPrefabs[classIndex], startPosition.position, startPosition.rotation);

        newPlayer.name = playerName;
        PlayerStats p = newPlayer.GetComponent <PlayerStats> ();

        p.teamIndex      = teams.Length > 1 ? teamIndex : -1;
        p.teamColor      = teams[teams.Length > 1 ? teamIndex : 0].teamColor;
        p.teamColorIndex = teams[teams.Length > 1 ? teamIndex : 0].teamColorIndex;
        p.playerName     = playerName;
        p.classIndex     = classIndex;
        PlayerGUI newPG = newPlayer.GetComponent <PlayerGUI>();

        newPG.desiredPlayerName  = playerName;
        newPG.desiredPlayerClass = classIndex;
        newPG.desiredTeamIndex   = teamIndex;
        NetworkServer.Spawn(newPlayer);
        // If not a bot, move connection to a new thing
        NetworkServer.ReplacePlayerForConnection(connection, newPlayer, 0);
        AssignPlayerId(newPlayer);
        GameObject.Destroy(source);

        // TODO find a better workaround
        // We damage the player for 0 here because there's a bug where the server crashes if they aren't
        // I don't really understand what the hell it means, but this should fix it
        //p.Hit(new HitArguments(p.gameObject, p.gameObject));
    }
コード例 #6
0
    //initialization of state
    void Start()
    {
        ani.GetComponent <Animator>();
        c1.GetComponent <Animator>();
        c2.GetComponent <Animator>();
        currentState = turnState.START;
        playerInput  = PlayerGUI.ACTIVATE;
        PlayerInBattle.AddRange(GameObject.FindGameObjectsWithTag("Player"));
        PlayerInBattle.AddRange(GameObject.FindGameObjectsWithTag("AI"));


        //player objects


        leftR  = GameObject.Find("Left_Rock");
        leftP  = GameObject.Find("Left_Paper");
        leftS  = GameObject.Find("Left_Scissors");
        rightR = GameObject.Find("Right_Rock");
        rightP = GameObject.Find("Right_Paper");
        rightS = GameObject.Find("Right_Scissors");

        //enemies
        e1 = GameObject.Find("Enemy 1");
        e2 = GameObject.Find("Enemy 2");
        e3 = GameObject.Find("Enemy 3");


        // canvas
        battleCanvas      = GameObject.Find("BattleCanvas");
        classSelectCanvas = GameObject.Find("ClassSelectionCanvas");
        resultCanvas      = GameObject.Find("ResultCanvas");
        battleCanvas.SetActive(false);
        classSelectCanvas.SetActive(true);
        resultCanvas.SetActive(false);
    }
コード例 #7
0
ファイル: PlayerAttack.cs プロジェクト: LunazGitHub/RPGgame
 void Start()
 {
     playerDamage = GetComponent <PlayerDamage>();
     playergui    = GetComponent <PlayerGUI>();
     Zombie       = GameObject.FindGameObjectWithTag("Enemy");
     //enemyhealthGUI = Zombie.GetComponent<EnemyHealthGUI>();
 }
コード例 #8
0
    void Start()
    {
        characterController = GetComponent <CharacterController>();
        player_ui           = GetComponent <PlayerGUI>();
        audioSource         = GetComponent <AudioSource>();
        bIsDead             = false;
        highScore           = 0;
        longestGameTime     = 0.0f;

        if (transform.childCount > 0)
        {
            model = transform.GetChild(0);
        }
        else
        {
            model = transform;
        }

        animator = model.GetComponent <Animator>();
        if (animator != null)
        {
            cachedAnimInfo = new CachedAnimInfo();
        }

        effectors = new List <PlayerEffector>();
    }
コード例 #9
0
    // Start is called before the first frame update
    void Start()
    {
        //Find Scripts
        movementScript = gameObject.GetComponent <PlayerMovement>();

        myAnimator = gameObject.GetComponent <Animator>();

        myPlayerGUI = playerGuiObject.GetComponent <PlayerGUI>();

        timer = new System.Diagnostics.Stopwatch();
        timer.Start();

        if (movementScript == null)
        {
            Debug.LogError("Movement Script is missing!");
        }

        if (myAnimator == null)
        {
            Debug.LogError("Animator Component is missing!");
        }

        currentState = (int)State.idle;

        if (loadFromDisk)
        {
            loadData();
        }
        else
        {
            setData();
        }
    }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        setPlayerInputs();

        dead = false;

        //Get Camera
        cameraTarget = GameObject.Find("CameraTarget");

        //Get player scripts
        interactionScript = this.gameObject.GetComponent <PlayerInteraction>();
        movementScript    = this.gameObject.GetComponent <PlayerMovement>();
        lookScript        = this.gameObject.transform.Find("LookCentre").gameObject.GetComponent <PlayerLook>();
        guiScript         = this.gameObject.GetComponent <PlayerGUI> ();

        inventory      = new GameObject[inventorySize];
        spawnInventory = new GameObject[inventorySize];

        deadzone = 0.25f;
        health   = MAX_HEALTH = 1.0f;
        //spawnPoint = this.transform.Find ("PlayerSpawnPoint").gameObject;

        /*cameraTarget = GameObject.Find ("CameraTarget");
         * rootCanvas = cameraTarget.transform.Find("Camera/Canvas").gameObject;
         * inventoryImage = rootCanvas.transform.Find("Canvas/Inventory").gameObject;
         *
         * itemImage = new GameObject[3];
         * itemImage[0] = inventoryImage.transform.Find ("1/Image").gameObject;
         * itemImage[1] = inventoryImage.transform.Find ("2/Image").gameObject;
         * itemImage[2] = inventoryImage.transform.Find ("3/Image").gameObject;
         */
    }
コード例 #11
0
ファイル: PlayerDelegate.cs プロジェクト: biikatto/zeroweight
    //private bool destroyed = false;

    void Start(){
        soundManager = gameObject.GetComponentInChildren<SoundManager>();

        energy = maxEnergy;
        score = FindObjectOfType(typeof(ScoreKeeper)) as ScoreKeeper;

        playerControl = gameObject.GetComponentInChildren<PlayerControl>();
        playerGUI = gameObject.GetComponentInChildren<PlayerGUI>();
        playerHealth = gameObject.GetComponentInChildren<PlayerHealth>();
        thrust = gameObject.GetComponentInChildren<Thrust>();
        
        shield = gameObject.AddComponent<Shield>() as Shield;
        shield.PDelegate = this;


        foreach(Weapon weapon in gameObject.GetComponentsInChildren(typeof(IWeapon))){
            if(weapon.gameObject.name == "Left weapon"){
                leftWeapon = weapon;
                leftWeapon.soundManager = soundManager;
            }else if(weapon.gameObject.name == "Right weapon"){
                rightWeapon = weapon;
                rightWeapon.soundManager = soundManager;
            }
        }
        StartCoroutine("RegenerateEnergy");
    }
コード例 #12
0
    public static void DoMiniCrafting(bool IsDone)
    {
        List <Data> dat = Check();

        if (dat[0].Key == -1)
        {
            GameManager._Instance.MCTGameObjs.B[4] = new BlockItem(0, 0);
            return;
        }

        if (IsDone)
        {
            for (int i = 0; i < 4; i++)
            {
                GameManager._Instance.MCTGameObjs.B[i].Drop(dat[i].Value);
            }

            Player.PStatus.Points += 10;
            PlayerGUI.Refresh();
            DoMiniCrafting(false);
        }
        else
        {
            GameManager._Instance.MCTGameObjs.B[4] = new BlockItem(dat[4].Key, dat[4].Value);
        }
    }
コード例 #13
0
 //initialization of state
 void Start()
 {
     currentState = turnState.START;
     playerInput  = PlayerGUI.ACTIVATE;
     PlayerInBattle.AddRange(GameObject.FindGameObjectsWithTag("Player"));
     PlayerInBattle.AddRange(GameObject.FindGameObjectsWithTag("AI"));
 }
コード例 #14
0
ファイル: GamePlay.cs プロジェクト: DioMuller/defend-uranus
        /// <summary>
        /// Creates a new GamePlay based on the user setup.
        /// </summary>
        /// <param name="game">Current game.</param>
        /// <param name="setup">Setup configuration.</param>
        public GamePlay(MainGame game, GamePlaySetup.Result setup)
            : base(game)
        {
            const int guiHMargin = 10;
            var       guiSize    = new Point(100, 160);

            var p1Ship = new Ship(this, setup.Player1Selection)
            {
                Position = new Vector2(-100, 0)
            };
            var p2Ship = new Ship(this, setup.Player2Selection)
            {
                Position = new Vector2(100, 0)
            };

            p1Ship.Behaviors.Add(new ShipInputBehavior(PlayerIndex.One, p1Ship));
            p2Ship.Behaviors.Add(new ShipInputBehavior(PlayerIndex.Two, p2Ship));

            _baseEntity = new PhysicsEntity();
            _ships      = new List <Ship> {
                p1Ship, p2Ship
            };
            _entities           = new List <GamePlayEntity>(_ships);
            _nonPhysicsEntities = new List <Entity>();
            _duration           = TimeSpan.Zero;

            _spawnAsteroids = new AsyncOperation(SpawnAsteroids);

            _p1Gui = new PlayerGUI("Player 1", p1Ship, new Point(guiHMargin, 0), guiSize);
            _p2Gui = new PlayerGUI("Player 2", p2Ship, new Point(GraphicsDevice.Viewport.Width - guiSize.X - guiHMargin, 0), guiSize);
        }
コード例 #15
0
ファイル: PlayerStatus.cs プロジェクト: zepa19/MineBattle
    public void TakeDamage(int d)
    {
        if (d < 0)
        {
            Health -= d;

            if (Health > 100)
            {
                Health = 100;
            }

            PlayerGUI.UpdateHealth();
        }
        else if (!Died && Player._Instance.CanEnemyAttack)
        {
            Player._Instance.CanEnemyAttack = false;
            Health -= Mathf.FloorToInt(d * (1 - ArmorBIT.Level / 8));

            GameManager._Instance.AttackEffect.Play();

            if (Health <= 0)
            {
                Health = 0;
                Died   = true;
                PlayerDeath();
            }

            if (Health > 100)
            {
                Health = 100;
            }

            PlayerGUI.UpdateHealth();
        }
    }
コード例 #16
0
    private void Start()
    {
        terrainMapOne = new int[, ]
        {
            { 0, 2, 0, 2, 1, 1, 0, 2, 0, 2 },
            { 2, 4, 2, 4, 1, 1, 2, 4, 2, 4 },
            { 3, 2, 3, 2, 1, 1, 3, 2, 3, 2 },
            { 2, 4, 2, 0, 1, 1, 2, 4, 2, 3 },
            { 3, 2, 4, 2, 1, 1, 0, 2, 0, 2 },
            { 2, 0, 2, 0, 1, 1, 2, 0, 2, 4 },
            { 4, 2, 3, 2, 1, 1, 3, 2, 3, 2 },
            { 2, 0, 2, 4, 1, 1, 2, 4, 2, 4 },
            { 3, 2, 3, 2, 1, 1, 0, 2, 0, 2 },
            { 2, 1, 2, 4, 1, 1, 2, 3, 2, 4 }
        };

        MapTarget  = GameObject.Find("Cube(0,0) (44)").transform;
        RedTarget  = GameObject.Find("Tank Variant").transform;
        BlueTarget = GameObject.Find("Tank (1) Variant").transform;

        redTank  = GameObject.Find("redTank");
        blueTank = GameObject.Find("blueTank");

        grid = new Grid(terrainMapOne, 4, 0, 5, 9);

        playerTurn = 1;
        round      = 1;

        theGUI     = FindObjectOfType <PlayerGUI>();
        redFire    = FindObjectOfType <RedShooter>();
        blueFire   = FindObjectOfType <BlueShooter>();
        cannonFire = GameObject.Find("Tank Variant").GetComponent <AudioSource>();
    }
コード例 #17
0
ファイル: BasePlayer.cs プロジェクト: PurdueSIGGD/ProjectW
    // Use this for initialization
    void Start()
    {
        /* every component that is a PlayerComponent must be initialized with the base player */
        myInput      = (PlayerInput)GetComponent <PlayerInput>().initialize(this);
        myMovement   = (PlayerMovement)GetComponent <PlayerMovement>().initialize(this);
        myStats      = (PlayerStats)GetComponent <PlayerStats>().initialize(this);
        myNetworking = (PlayerNetworking)GetComponent <PlayerNetworking>().initialize(this);
        myGUI        = (PlayerGUI)GetComponent <PlayerGUI>().initialize(this);
        myEffects    = (PlayerEffects)GetComponent <PlayerEffects>().initialize(this);
        PlayerAbility[] abilityCandidates = GetComponents <PlayerAbility>();
        myAbilities = new PlayerAbility[abilityCandidates.Length];
        int myAbilityIndex = 0;

        foreach (PlayerAbility playerAbility in abilityCandidates)
        {
            myAbilities[myAbilityIndex] = (PlayerAbility)playerAbility.initialize(this);
            myAbilityIndex++;
        }


        myAnimator           = transform.GetChild(0).GetComponent <Animator>();
        myRigid              = GetComponent <Rigidbody>();
        myCollider           = GetComponent <Collider>();
        myNoFrictionCollider = transform.Find("NoFrictionSides").GetComponent <Collider>();
        myNetworkIdentity    = this.GetComponent <NetworkIdentity>();

        if (isServer)
        {
            playerId = Guid.NewGuid().ToString();
        }
    }
コード例 #18
0
 public void Input2(GameObject choosenEnemy) //enemy selection
 {
     //lua chon enemy can tan cong
     playerChoice.AttackersTarget = choosenEnemy;
     Debug.Log("perform atatck with " + choosenEnemy);
     //chuyen trang thai PlayerGUI thanh done
     playerInput = PlayerGUI.DONE;
 }
コード例 #19
0
ファイル: EnemyAttack.cs プロジェクト: LunazGitHub/RPGgame
 void Awake()
 {
     player         = GameObject.FindGameObjectWithTag("Player");
     box            = GetComponent <BoxCollider>();
     playerGUI      = player.GetComponent <PlayerGUI>();
     anim           = GetComponentInParent <Animator>();
     enemyHealthGUI = GetComponent <EnemyHealthGUI>();
 }
コード例 #20
0
 void Start()
 {
     audio     = GetComponent <AudioSource>();
     magazine  = magazineSize;
     ais       = FindObjectsOfType(typeof(AI)) as AI[];
     playerGUI = FindObjectOfType <PlayerGUI> ();
     playerGUI.Ammo(ammunitionTotal, magazine);
 }
コード例 #21
0
ファイル: Actions.cs プロジェクト: cnburrows/UnitySimpleFPS
 // Use this for initialization
 void Start()
 {
     ais           = FindObjectsOfType(typeof(AI)) as AI[];
     currentAction = Instantiate(actions[0], transform.position, transform.rotation) as GameObject;
     currentAction.transform.parent        = PlayerCamera.transform;
     currentAction.transform.localPosition = new Vector3(currentAction.transform.localPosition.x + 0.25f, currentAction.transform.localPosition.y + 0.7f, currentAction.transform.localPosition.z + 0.3f);
     playerGUI = FindObjectOfType <PlayerGUI> ();
 }
コード例 #22
0
 // Use this for initialization
 void Start()
 {
     _gui        = GetComponentInParent <PlayerGUI>();
     _player     = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     _inventory  = GameObject.FindGameObjectWithTag("InventoryCanvas").GetComponent <GUIManager>().inventoryGUI;
     _itemImage  = GetComponentInChildren <Image>();
     _baseSprite = GetDefaultSprite();
 }
コード例 #23
0
 void Awake()
 {
     playerGUI  = GetComponent <PlayerGUI>();
     clients    = new List <Client>();
     workStatus = WorkStatus.Open;
     money      = startingMoney;
     dataLoader = FindObjectOfType <PlayerDataLoader>();
 }
コード例 #24
0
    public void PlayerInputComplete()
    {
        performList.Add(heroChoice);
        ResetActionPanel();

        heroManageList[0].transform.Find("TurnPointer").gameObject.SetActive(false);
        heroManageList.RemoveAt(0);
        playerInput = PlayerGUI.ACTIVATE;
    }
コード例 #25
0
ファイル: PlayerStatus.cs プロジェクト: zepa19/MineBattle
 public void PrepareToolbox()
 {
     if (PlayerSettings.FromSave)
     {
         ToolBox9 = new List <BlockItem>(PlayerSettings.toolbox);
         PlayerGUI.UpdateMiniCraftingTable();
         PlayerGUI.UpdateToolbar();
     }
 }
コード例 #26
0
 public override void run(GameObject opponent, PlayerGUI gui)
 {
     if (base.currentCooldown <= 0 && points.getScore() > pointsRequired - 1)
     {
         showOutput(gui);
         opponent.GetComponent <PlayerMovement>().setRotationSpeed(-opponent.GetComponent <PlayerMovement>().getRotationSpeed());
         base.currentCooldown = base.cooldownTime;
     }
 }
コード例 #27
0
 public override void run(GameObject opponent, PlayerGUI gui)
 {
     if (base.currentCooldown <= 0 && points.getScore() >= pointsRequired)
     {
         showOutput(gui);
         opponent.GetComponent <PointControl>().setHasPoint(false);
         base.currentCooldown = base.cooldownTime;
     }
 }
コード例 #28
0
 public override void run(GameObject opponent, PlayerGUI gui)
 {
     if (base.currentCooldown <= 0 && points.getScore() >= pointsRequired)
     {
         showOutput(gui);
         opponent.GetComponent <PlayerMovement>().setDelay(100f);
         base.currentCooldown = base.cooldownTime;
     }
 }
コード例 #29
0
 public override void run(GameObject opponent, PlayerGUI gui)
 {
     if (base.currentCooldown <= 0)
     {
         showOutput(gui);
         control.resetDefaults();
         base.currentCooldown = base.cooldownTime;
     }
 }
コード例 #30
0
 public override void run(GameObject opponent, PlayerGUI gui)
 {
     if (base.currentCooldown <= 0 && points.getScore() >= pointsRequired)
     {
         showOutput(gui);
         fire.SetActive(true);
         sb.FinalScreen(points.playerNum, 4f);
         base.currentCooldown = base.cooldownTime;
     }
 }
コード例 #31
0
    void HeroInputDone()
    {
        PerformList.Add(HeroChoice);
        //clean the action panel
        clearAttackPanel();

        HeroToManager[0].transform.Find("Selector").gameObject.SetActive(false);
        HeroToManager.RemoveAt(0);
        PlayerInput = PlayerGUI.ACTIVE;
    }
コード例 #32
0
ファイル: GameController.cs プロジェクト: Orthak/Simplicity
 private void Start()
 {
     playerGUI = GameObject.Find("Player").GetComponent<PlayerGUI>();
     player = GameObject.Find("Player").GetComponent<PlayerStats>();
     gameOverCamera = GameObject.Find("GameOverMenuCamera").camera;
     gameOverCamera.enabled = false;
     Screen.showCursor = false;
     currentArea = 1;
     SpawnEnemies();
 }
コード例 #33
0
ファイル: Player.cs プロジェクト: sean-h/spacegame
 private void Awake()
 {
     shipController.player = this;
     shipController.GetTarget += GetTargetShip;
     _playerGUI = this.GetComponentInChildren<PlayerGUI>();
     if (_playerGUI == null)
     {
         Debug.LogError("PlayerGUI not found!");
     }
 }
コード例 #34
0
ファイル: Player.cs プロジェクト: ice0001/Cubes-in-Space
    // Use this for initialization
    void Start()
    {
        mouseLook = Camera.mainCamera.GetComponent<MouseLook>();
        mouseFollow = Camera.mainCamera.GetComponent<SmoothFollowCS>();
        //set camera
        mouseFollow.enabled = false;
        mouseFollow.target = gameObject.transform;
        mouseFollow.targetLocation = gameObject.transform.position;
        sender = GetComponent<NetworkLaunchMessageSender>();

        //GUI initializers
        owners = new List<int>();
        myGUI = this.GetComponent<PlayerGUI>();
        guiText = (GUIText)GameObject.Find("GUI Text").GetComponent<GUIText>();
    }
コード例 #35
0
	void Start () {
	    characterController = GetComponent<CharacterController>();
        player_ui = GetComponent<PlayerGUI>();
        audioSource = GetComponent<AudioSource>();
        bIsDead = false;
        highScore = 0;
        longestGameTime = 0.0f;

        if(transform.childCount > 0) {
            model = transform.GetChild(0);
        }
        else {
            model = transform;
        }

        animator = model.GetComponent<Animator>();
        if(animator != null) {
            cachedAnimInfo = new CachedAnimInfo();
        }

        effectors = new List<PlayerEffector>();
	}
コード例 #36
0
ファイル: PlayerGUI.cs プロジェクト: ddrocco/adrift
	// Use this for initialization
	void Start () {
		main = this;
		guistate = GUIState.playing;
	}
コード例 #37
0
 private void Start()
 {
     player = this.gameObject.GetComponent<PlayerStats>();
     playerGUI = this.gameObject.GetComponent<PlayerGUI>();
     gameOverCamera = GameObject.Find("GameOverMenuCamera").camera;
 }
コード例 #38
0
	void Awake(){
		gui = GetComponent<PlayerGUI>();
	}
コード例 #39
0
 void Awake()
 {
     plrgui = GameObject.Find("Player").GetComponent<PlayerGUI>();
     invgui = (InventoryGUI)GameObject.Find("GUIComponents").GetComponent("InventoryGUI");
 }
コード例 #40
0
ファイル: PlayerGUI.cs プロジェクト: DannyBoyThomas/Project-Z
 public void Awake()
 {
     Instance = this;
 }
コード例 #41
0
ファイル: Player.cs プロジェクト: NormantasKudzma/RoomFighter
 void Awake()
 {
     health = maxHealth;
     mana = maxMana;
     plr = GameObject.Find("Player");
     gui = plr.GetComponent<PlayerGUI>();
     InitVars();
 }
コード例 #42
0
    void Start()
    {
        AstarScan();
        pg = GetComponent<PlayerGUI>();
        HungerTimer = Time.timeSinceLevelLoad;

        // —оздание ¤чеек инвентар¤
        if (Stacks.Count == 0)
            for (int i = 0; i < 10; i++)
            {
                MyStack S = new MyStack();
                Stacks.Add(S);
            }

        myRad = (GameObject)Instantiate(Resources.Load("Objects/PlayerRadZone"), transform.position + Vector3.up, Quaternion.identity);
        myRad.GetComponent<PlayerRadZone>().myPlayer = transform;
        myRad.GetComponent<RadZone>().myMaxRad = myRadLevel;
        myRad.name = name + " Rad";

        AstarScan();
        Invoke("AstarScanNow", 1);
    }
コード例 #43
0
 public GUIStatePlayerInventory(PlayerGUI playerGUI)
 {
     this.playerGUI = playerGUI;
 }
コード例 #44
0
ファイル: Player.cs プロジェクト: eric-kansas/Cubes-in-Space
    // Use this for initialization
    void Start()
    {
        mouseLook = Camera.mainCamera.GetComponent<MouseLook>();
        mouseFollow = Camera.mainCamera.GetComponent<SmoothFollowCS>();
        //set camera
        mouseFollow.enabled = false;
        mouseFollow.target = gameObject.transform;
        mouseFollow.targetLocation = gameObject.transform.position;
        sender = GetComponent<NetworkLaunchMessageSender>();

        //GUI initializers
        owners = new List<int>();
        myGUI = this.GetComponent<PlayerGUI>();
        distGUI = (GUIText)GameObject.Find("GUI Text Distance").GetComponent<GUIText>();
        paintGUI = (GUIText)GameObject.Find("GUI Text Paint").GetComponent<GUIText>();
        crosshairGUI = (GUITexture)GameObject.Find("Crosshair Outer").GetComponent<GUITexture>();
        crosshairGUI.color = color;

        GameObject gameMan = GameObject.Find("GameManager");
        gManScript = gameMan.GetComponent<GameManager>();
        refuel();
    }
コード例 #45
0
ファイル: PlayerStats.cs プロジェクト: Orthak/Simplicity
    private void Start()
    {
        enemy = GameObject.Find("Enemy").GetComponent<EnemyStats>()
                ?? (enemy = new EnemyStats());
        guiElements = this.gameObject.GetComponent<PlayerGUI>();
        playerDeathSound = GameObject.Find("PlayerDeathSound").GetComponent<PlayerAudio>();
        playerLevelUpSound = GameObject.Find("PlayerLevelUpSound").GetComponent<PlayerAudio>();

        SetStartingStats();
    }
コード例 #46
0
 public GUIStatePlayerNormal(PlayerGUI playerGUI)
 {
     this.playerGUI = playerGUI;
 }
コード例 #47
0
ファイル: AbilityDrop.cs プロジェクト: SuperJura/RPGGame
 void Start()
 {
     playerGUI = GameObject.Find("PlayerObject/NamePlate").GetComponent<PlayerGUI>();
 }
コード例 #48
0
 void Start()
 {
     // Debug
     print("I was created (Player)");
     // Debug
     pi = GetComponent<PlayerInfo>();
     pg = GetComponent<PlayerGUI>();
     bot = GetComponent<MineBotAI>();
     animator = GetComponent<Animator>();
     MyCamera = GameObject.Find("MyCamera").transform;
     particleClone = Instantiate(particle.gameObject, transform.position, Quaternion.identity) as GameObject;
     destinationPoint = hp = transform.position;
 }
コード例 #49
0
    void Start()
    {
        AstarScan();
        pg = GetComponent<PlayerGUI>();
        HungerTimer = Time.timeSinceLevelLoad;

        newHealth = Health; newHunger = Hunger;

        // —оздание ¤чеек инвентар¤
        if (Stacks.Count == 0)
            for (int i = 0; i < 10; i++)
            {
                MyStack S = new MyStack();
                Stacks.Add(S);
            }

        myRad = (GameObject)Instantiate(Resources.Load("Objects/PlayerRadZone"), transform.position + Vector3.up, Quaternion.identity);
        myRad.GetComponent<PlayerRadZone>().myPlayer = transform;
        myRad.GetComponent<RadZone>().myMaxRad = myRadLevel;
        myRad.name = name + " Rad";

        AstarScan();
        Invoke("AstarScanNow", 1);

        foreach (MyStack obj in Stacks)
        {
            if (obj.GetName() != "")
                if (obj.MyItems[0].weapon && obj.MyItems[0].active)
                {
                    SetActiveWeapon(obj.MyItems[0]);
                    break;
                }
        }

        if (activeSuit.name != "")
        {
            DressSuit(activeSuit);
        }
    }