コード例 #1
0
    public void Exit()
    {
        HttpClient client = new HttpClient();

        string uri;

        if (pirate)
        {
            uri = "http://boardserverconnection.azurewebsites.net/api/delete/1/" + player;
        }
        else
        {
            uri = "http://boardserverconnection.azurewebsites.net/api/delete/0/" + player;
        }

        Debug.Log(uri);
        client.GetString(new System.Uri(uri), (r) =>
        {
            read = r.Data;
            read = read.Trim(new char[2] {
                '"', '\\'
            });
            Debug.Log(read);
        });
        playerManager pM = GameObject.FindObjectOfType <playerManager>();

        Destroy(pM.gameObject);
        Destroy(pM);
        SceneManager.LoadScene("Entry");
    }
コード例 #2
0
ファイル: gameManager.cs プロジェクト: akashpathuri/SumoCars
    public static void registerPlayer(string netId, playerManager player)
    {
        string id = PLAYERIDPREFIX + netId;

        players.Add(id, player);
        player.transform.name = id;
    }
コード例 #3
0
    public override void objectSpawned(spaceComponent startingPoint, bool isPlayer)
    {
        maxHealth = health;

        myHealthBar = Instantiate(healthBar, GameObject.Find("Canvas").transform);
        Vector2 barSpot = Camera.main.WorldToScreenPoint(transform.position);

        myHealthBar.transform.position = new Vector2(barSpot.x, barSpot.y + barOffset);

        playerUnit = isPlayer;
        mySpace    = startingPoint;

        if (playerUnit)
        {
            myManager = GameObject.Find("PlayerObject").GetComponent <playerManager>();
        }
        else
        {
            myManager = GameObject.Find("EnemyObject").GetComponent <playerManager>();
        }
        currentMoney = myManager.money;

        AudioMan.inst.PlayThief();

        mySpace.addUnit(this);
        StartCoroutine(waitToAct(0.001F));
    }
コード例 #4
0
 void Awake()
 {
     if (!PM)
     {
         PM = this;
     }
 }
コード例 #5
0
    //private bool isIdle;

    // Start is called before the first frame update
    void Start()
    {
        Anim    = GetComponent <Animator>();
        manager = GetComponent <playerManager>();

        isAttacking = false;
    }
コード例 #6
0
    void Start()
    {
        rb   = gameObject.GetComponent <Rigidbody2D>();
        pm   = gameObject.GetComponent <playerManager>();
        anim = gameObject.GetComponent <Animator>();

        rb.gravityScale = 0.0f;
    }
コード例 #7
0
 private void Awake()
 {
     _instance = this;
     if (PlayerPrefs.GetInt("DaffodilSeed") < 1)
     {
         PlayerPrefs.SetInt("DaffodilSeed", 1);
     }
 }
コード例 #8
0
    void Start()
    {
        pm = player.GetComponent <playerManager>();
        cm = player.GetComponent <commandManagement>();

        vicScreen.SetActive(false);
        enHealth = maxEnHealth;
    }
コード例 #9
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "bullet" && playerManager.isKillable == true) // If hitbox collides with bullet
     {
         Destroy(collision.gameObject);
         playerManager playerScript = GetComponentInParent <playerManager>();
         playerScript.StartCoroutine("death");
         UICounterStatic.UIScript.updateLife(-1);
         UICounterStatic.UIScript.resetGraze();
     }
 }
コード例 #10
0
ファイル: playerManager.cs プロジェクト: oprel/cuckoo
 void Awake()
 {
     self = this;
     ball[] bs = FindObjectsOfType <ball>();
     foreach (ball b in bs)
     {
         if (!b.trash)
         {
             balls.Add(b.gameObject);
         }
     }
 }
コード例 #11
0
    // Use this for initialization
    void Start()
    {
        playerManager pM = GameObject.FindObjectOfType <playerManager>();

        pirate = pM.pirate;
        player = pM.player;

        foreach (Room r in Board.GetComponentsInChildren <Room>())
        {
            Rooms.Add(r);
        }
    }
コード例 #12
0
    private void Awake()
    {
        checkpoints = GameObject.FindGameObjectsWithTag("Checkpoint");

        if (_Instance == null)
        {
            _Instance = this;
        }
        else
        {
            Destroy(this);
        }
    }
コード例 #13
0
ファイル: enemySpawn.cs プロジェクト: Lebrra/summaJam
    // Start is called before the first frame update
    void Start()
    {
        spawnCooldowns = new bool[units.Length];
        for (int i = 0; i < spawnCooldowns.Length; i++)
        {
            spawnCooldowns[i] = false;
        }
        cooldowns = new float[units.Length];

        chooseNewChoice();
        myChoice = 0;
        manager  = GetComponent <playerManager>();
    }
コード例 #14
0
    void Start()
    {
        //make health show at start
        pm = player.GetComponent <playerManager>();
        em = enemy.GetComponent <enemyManager>();

        heart1.SetActive(true);
        heart2.SetActive(true);
        heart3.SetActive(true);
        heart4.SetActive(true);
        heart5.SetActive(true);

        //
        scrnColor = scrnDark.color;
    }
コード例 #15
0
ファイル: EntryManager.cs プロジェクト: GramlingC/Airlock
    void begin()
    {
        if (!ready)
        {
            return;
        }
        playerManager pM = GameObject.FindObjectOfType <playerManager>();

        pM.player = player;
        pM.pirate = toggle.isOn;
        if (toggle.isOn)
        {
            SceneManager.LoadScene("PirateBoard");
        }
        else
        {
            SceneManager.LoadScene("ShipBoard");
        }
    }
コード例 #16
0
ファイル: Battery.cs プロジェクト: GabrielM97/SavingTheSparks
    private void OnTriggerEnter(Collider other)
    {
        Debug.Log("Battery triggered");

        if (other.tag == "Player")
        {
            playerManager pm = other.gameObject.GetComponent <playerManager>();

            Debug.Log(pm.charge);
            pm.charge += batteryCharge;
            uses--;

            if (uses == 0)
            {
                batteryCharge = 0;
            }

            Debug.Log(pm.charge);
        }
    }
コード例 #17
0
    void Awake()
    {
        wantedMode = CursorLockMode.Locked;
        SetCursorState();
        player = this;

        if (walkSetting == WalkSetting.Code)
        {
            _forceAcceleration = 6440f;
            _minimumSpeed      = 7f;
            _maximumSpeed      = _minimumSpeed;
            _timeToStop        = 0.2f;
            airControlRatio    = 1f;
            verticalAddForce   = 1000f;
            dropVelocity       = 100f;
            maxSlope           = 60f;
        }

        originalDropVol = dropVelocity;
        timer           = 0;
        _flip           = false;
    }
コード例 #18
0
 private void Awake()
 {
     theManager = FindObjectOfType <playerManager>();
     isPlanted  = false;
 }
コード例 #19
0
 void Awake()
 {
     instance = this;
 }
コード例 #20
0
ファイル: cameraManager.cs プロジェクト: Doyrd/Project-files
 void Start()
 {
     thePlayer          = FindObjectOfType <playerManager>();
     lastPlayerPosition = thePlayer.transform.position;
 }
コード例 #21
0
 private void Awake()
 {
     thePM = FindObjectOfType <playerManager>();
 }
コード例 #22
0
 void Awake()
 {
     Instance = this;
 }
コード例 #23
0
ファイル: playerMotor.cs プロジェクト: jansenMurphy/Workshops
 void Awake()
 {
     rb = GetComponent <Rigidbody> ();
     lm = LayerMask.GetMask("Default");
     pm = GetComponent <playerManager> ();
 }
コード例 #24
0
 private void Awake()
 {
     theManager = FindObjectOfType <playerManager>();
     Debug.Log(theManager.gameObject.name);
 }
コード例 #25
0
    public static void Respawn()
    {
        playerManager PM = GameObject.FindGameObjectWithTag("player").GetComponent <playerManager>();

        PM.Respawn(CurrentSpawnZone.SP.transform.position);
    }
コード例 #26
0
 void Start()
 {
     pm    = gameObject.GetComponent <playerManager>();
     cm    = GetComponent <commandManagement>();
     timer = maxTime;
 }
コード例 #27
0
 // Use this for initialization
 void Start()
 {
     PM = GetComponent <playerManager>();
 }
コード例 #28
0
 void Start()
 {
     pm = player.GetComponent <playerManager>();
     deathScreen.SetActive(false);
     pauseMenuUI.SetActive(false);
 }
コード例 #29
0
ファイル: Platform.cs プロジェクト: trananh1992/ParkOurGame
	// Use this for initialization
	void Start () {
		Player = GameObject.FindWithTag ("Player");
		ScriptplayerManger = Player.transform.GetComponent<playerManager>();
		PlatformCreatorObject = GameObject.FindWithTag ("PlatformCreator");
		ScriptPlatformCreator = PlatformCreatorObject.GetComponent<PlatformCreator>();
	}
コード例 #30
0
 private void Awake()
 {
     instance = this;
 }
コード例 #31
0
 // Use this for initialization
 void Start()
 {
     Manager = GetComponent <playerManager> ();
     rb2d    = GetComponent <Rigidbody2D> ();
 }