コード例 #1
0
 public SpaceshipData(int spaceshipTypeIndex, GeometryManager.Position position, int level, int experiencePoints)
 {
     this.spaceshipTypeIndex = spaceshipTypeIndex;
     this.position           = position;
     this.level            = level;
     this.experiencePoints = experiencePoints;
 }
コード例 #2
0
    public GameObject SpawnSpaceshipTypeAtPos(SpaceshipType sType, GeometryManager.Position pos)
    {
        //Debug.Log("Spawning saved spaceship");
        GameObject instantiatedSpaceship = Instantiate(sType.prefab, new Vector3(pos.x, pos.y, pos.z), Quaternion.identity);

        // Attribute ID to spaceship
        AllySpaceship allyS = instantiatedSpaceship.GetComponent <AllySpaceship>();

        allyS.Initialize();
        allyS.id            = GetAvailableSpaceshipId();
        allyS.spaceshipType = sType;

        AddAlliedSpaceshipToList(instantiatedSpaceship);

        instantiatedSpaceship.transform.SetParent(spaceshipsParent.transform);

        UpdateFleetPointsInfo();

        return(instantiatedSpaceship);
    }