public void InstantiateHullRenderer(ShipHullRenderer hullPrefab, WeaponInformationType canonType)
    {
        if (currentHullObject != null)
        {
            ClearLastHullRenderer();
        }

        currentHullObject = Object.Instantiate(hullPrefab, rotationParent);
        currentHullObject.transform.localPosition = Vector3.zero;
        currentHullObject.transform.localRotation = Quaternion.identity;
        currentHullObject.name = "Currently Equiped Hull";

        hullPrefab.CheckObjectsToShow(canonType);
    }
Exemple #2
0
    public void CheckObjectsToShow(WeaponInformationType weaponType)
    {
        if (weaponType == WeaponInformationType.FrontCanons)
        {
            if (frontCanon != null)
            {
                frontCanon.SetActive(true);
            }

            foreach (GameObject canon in sideCanons)
            {
                if (canon != null)
                {
                    canon.SetActive(false);
                }
            }
        }
        else if (weaponType == WeaponInformationType.SideCanons)
        {
            if (frontCanon != null)
            {
                frontCanon.SetActive(false);
            }

            foreach (GameObject canon in sideCanons)
            {
                if (canon != null)
                {
                    canon.SetActive(true);
                }
            }
        }
        else if (weaponType == WeaponInformationType.MultiCanons)
        {
            if (frontCanon != null)
            {
                frontCanon.SetActive(true);
            }

            foreach (GameObject canon in sideCanons)
            {
                if (canon != null)
                {
                    canon.SetActive(true);
                }
            }
        }
    }
Exemple #3
0
    public void OpenWeaponInformations(WeaponInformationType weaponType, WeaponInformationShotType shotType, WeaponInformationEffect effect)
    {
        hullInformationsParent.SetActive(false);
        weaponInformationsParent.SetActive(true);

        weaponTypeText.text =
            weaponType == WeaponInformationType.Catapult ? "Catapult" :
            weaponType == WeaponInformationType.FrontCanons ? "Front Canon" :
            weaponType == WeaponInformationType.SideCanons ? "Side Canon" :
            weaponType == WeaponInformationType.MultiCanons ? "Multi Canon" :
            "";

        weaponShotTypeText.text = shotType == WeaponInformationShotType.SingleShot ? "Single Shot" : shotType.ToString();

        weaponEffectText.text = effect == WeaponInformationEffect.NoEffect ? "No Effect" : effect.ToString();
    }