コード例 #1
0
 // Use this for initialization
 void Start()
 {
     healthButton.onClick.AddListener(BuyHealth);
     dammageButton.onClick.AddListener(BuyDammage);
     shootSpeedButton.onClick.AddListener(ButSpeed);
     shop = this;
     UpdateGUI();
 }
コード例 #2
0
    public SupplierPlayer(string name, float money, float markup, float maximumInventorySpace, int shopItemSlotCount) : base(name)
    {
        Money              = money;
        MarkupPercentage   = markup;
        CustomerTolerance  = 1f;
        WarehouseInventory = new InventoryPlayer(maximumInventorySpace);
        Shop = new PlayerShop(shopItemSlotCount);

        ResetMoneyStart();
    }
コード例 #3
0
ファイル: Shop.cs プロジェクト: tediris/CS194GameDev
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         PlayerShop shop = other.gameObject.GetComponent <PlayerShop> ();
         if (shop != null)
         {
             shop.DisableBuy();
         }
     }
 }
コード例 #4
0
ファイル: Shop.cs プロジェクト: tediris/CS194GameDev
    // Use this for initialization
//	void Start () {
//
//	}

    // Update is called once per frame
//	void Update () {
//
//	}

    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            PlayerShop shop = other.gameObject.GetComponent <PlayerShop> ();
            if (shop != null)
            {
                shop.EnableBuy(petForSale, price);
            }
        }
    }
コード例 #5
0
ファイル: PlayerShop.cs プロジェクト: SynGameDev/ProjectHack
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
コード例 #6
0
    private void Awake()
    {
        Instance    = this;
        playerBase  = GetComponent <Player_Base>();
        playerPunch = GetComponent <PlayerPunch>();
        playerSword = GetComponent <PlayerSword>();

        playerBase.enabled  = true;
        playerPunch.enabled = false;
        playerSword.enabled = false;

        healthPotionAmount = 1;
    }
コード例 #7
0
    // Update is called once per frame
    void Update()
    {
        gun.dammage   = PlayerShop.GetDammage();
        gun.fireSpeed = 1 / (Mathf.Log(5 + PlayerShop.GetSpeed()));

        if (isShooting)
        {
            gun.gameObject.SendMessage("Shoot");
        }

        /*
         * if (gun.GetIsAutomatic())
         * {
         *
         *
         * }
         * else {
         *  if (Input.GetMouseButtonDown(0)){
         *      gun.gameObject.SendMessage("Shoot");
         *  }
         * }
         */
    }
コード例 #8
0
ファイル: PlayerControl.cs プロジェクト: tediris/CS194GameDev
    // Use this for initialization
    void Start()
    {
        shop           = GetComponent <PlayerShop> ();
        playerBody     = GetComponent <Rigidbody2D> ();
        networkInfo    = GetComponent <NetSetup> ();
        carryControl   = GetComponent <CarryControl> ();
        anim           = GetComponent <Animator> ();
        gravityInitial = playerBody.gravityScale;
        wallCheck      = GetComponentInChildren <WallCheck> ();
        baitManager    = GetComponent <BaitManager> ();
        string[] controllers = Input.GetJoystickNames();
        foreach (string s in controllers)
        {
            Debug.Log(s);
        }
        if (controllers.Length > 0)
        {
            controllerEnabled = true;
        }
        input = new GeneralInput();
        input.controllerEnabled = controllerEnabled;
//
//		superJumpModeText = GameObject.Find ("PowerJumpMode").GetComponent<Text> ();
    }
コード例 #9
0
ファイル: PlayerControl.cs プロジェクト: tediris/CS194GameDev
	// Use this for initialization
	void Start () {
		shop = GetComponent<PlayerShop> ();
		playerBody = GetComponent<Rigidbody2D> ();
		networkInfo = GetComponent<NetSetup> ();
		carryControl = GetComponent<CarryControl> ();
		anim = GetComponent<Animator> ();
		gravityInitial = playerBody.gravityScale;
		wallCheck = GetComponentInChildren<WallCheck> ();
		baitManager = GetComponent<BaitManager> ();
		string[] controllers = Input.GetJoystickNames ();
		foreach (string s in controllers) {
			Debug.Log (s);
		}
		if (controllers.Length > 0) {
			controllerEnabled = true;
		}
		input = new GeneralInput ();
		input.controllerEnabled = controllerEnabled;
//
//		superJumpModeText = GameObject.Find ("PowerJumpMode").GetComponent<Text> ();
	}
コード例 #10
0
 private void Awake()
 {
     playerShop = DataPlayer.GetModule <PlayerShop>();
     InitButtons();
     InitLocalize();
 }
コード例 #11
0
 void Awake()
 {
     Instance     = this;
     pDeck        = PlayerCardDeck.Instance;
     spawnManager = SpawnManager.Instance;
 }
コード例 #12
0
 // Update is called once per frame
 void Update()
 {
     maxHealth = PlayerShop.GetHealth();
 }
コード例 #13
0
 // Use this for initialization
 void Start()
 {
     maxHealth     = PlayerShop.GetHealth();
     currentHealth = maxHealth;
 }