コード例 #1
0
 public void SelectSpaceshipOnShop(SpaceshipManager.SpaceshipType spaceshipType)
 {
     if (spaceshipType != null)
     {
         //Debug.Log("SelectSpaceshipOnShop [" + spaceshipType.typeName + "]");
         selectedSpaceshipType = spaceshipType;
         if (ResourcesManager.instance.CanPayResourceAmounts(spaceshipType.resourceCosts) && SpaceshipManager.instance.HasAvailableFleetPointsNb(selectedSpaceshipType.fleetPointsNeeded))
         {
             buySpaceshipButton.SetActive(true);
             EnableOnlyThisSpaceshipShopItemBorder(spaceshipType);
         }
         else
         {
             buySpaceshipButton.SetActive(false);
             DisableAllSpaceshipShopItemsBorder();
         }
     }
 }
コード例 #2
0
    // Deprecated
    public void SpawnSpaceshipOfType(SpaceshipManager.SpaceshipType spaceshipType)
    {
        Debug.Log("SpawnSpaceshipOfType [" + spaceshipType.typeName + "]");

        Vector2 randomCirclePos = Random.insideUnitCircle.normalized;
        Vector3 pos             = transform.position + new Vector3(randomCirclePos.x * spawnRadius, randomCirclePos.y * spawnRadius, 0f);

        GameObject instantiatedSpaceship = Instantiate(spaceshipType.prefab, pos, Quaternion.Euler(0, 90, 0));

        instantiatedSpaceship.transform.SetParent(SpaceshipManager.instance.spaceshipsParent);

        // Set attributes
        instantiatedSpaceship.GetComponent <Spaceship>().SetSpaceshipType(spaceshipType);
        instantiatedSpaceship.GetComponent <Spaceship>().homeSpaceport = gameObject;

        attachedSpaceships.Add(instantiatedSpaceship);
        SpaceshipManager.instance.AddAlliedSpaceshipToList(instantiatedSpaceship);

        //SpaceportInfoPanel.instance.ImportInfo();
    }
コード例 #3
0
 public void EnableOnlyThisSpaceshipShopItemBorder(SpaceshipManager.SpaceshipType spaceshipType)
 {
     DisableAllSpaceshipShopItemsBorder();
     spaceshipType.associatedSpaceshipShopItem.GetComponent <SpaceshipTypeShopPanel>().DisplayBorderPanel(true);
 }
コード例 #4
0
 public void SetAssociatedSpaceshipType(SpaceshipManager.SpaceshipType spaceshipType)
 {
     associatedSpaceshipType = spaceshipType;
 }
コード例 #5
0
ファイル: Spaceship.cs プロジェクト: Latheror/Orbital-Crisis
 public void SetSpaceshipType(SpaceshipManager.SpaceshipType sType)
 {
     spaceshipType = sType;
 }