示例#1
0
    private void OnMouseDown()
    {
        CmdSpawnBuilding(
            TerrainPointerControllerProvider.GetInstance().transform.position + Vector3.up * 3f
            , PlayerScript.GetInstance().Team
            );

        TerrainPointerControllerProvider.GetInstance().DetachObject();
    }
示例#2
0
        public void OnClick()
        {
            VisibleLogger.GetInstance().LogDebug("Button clicked");

            if (TerrainPointerControllerProvider.GetInstance().IsObjectAttached)
            {
                VisibleLogger.GetInstance().LogDebug("Detaching children");
                TerrainPointerControllerProvider.GetInstance().DetachObject();
            }
            else
            {
                if (PlayerScript.GetInstance().Gold < _buildingAttributes.BuildCost)
                {
                    VisibleLogger.GetInstance().LogDebug("Not enought money to build");
                    return;
                }

                VisibleLogger.GetInstance().LogDebug("Attaching children");
                TerrainPointerControllerProvider.GetInstance().AttachObject(FactoryBuildPreview, TerrainPointerController.GridAllignementOption.ALLIGN_TO_GRID);
            }
        }
        public override void OnStartAuthority()
        {
            base.OnStartAuthority();

            TerrainPointerControllerProvider.SetTerrainPointerController(this);
        }