示例#1
0
    private void OnTriggerExit(Collider other)
    {
        PlanetEffect effect = other.attachedRigidbody.GetComponent <PlanetEffect>();

        if (effect)
        {
            effect.effectActive = true;
        }
    }
示例#2
0
    void onExitCloseRadius(GameObject obj)
    {
        PlanetEffect effect = obj.GetComponent <PlanetEffect>();

        if (effect)
        {
            effect.effectActive = true;
        }
    }
示例#3
0
    void onExitExclusionZone(GameObject obj)
    {
        PlanetEffect effect = obj.GetComponent <PlanetEffect>();

        if (effect)
        {
            effect.effectActive = true;
            effect.GetComponent <Rigidbody>().useGravity = false;
        }
    }
示例#4
0
    private void OnTriggerExit(Collider other)
    {
        if (other.attachedRigidbody)
        {
            PlanetEffect effect = other.attachedRigidbody.GetComponent <PlanetEffect>();
            UpdateTPZone(other.GetComponent <IcoPlanet>(), false);

            if (effect)
            {
                m_planetEffectsList.Remove(effect);
                Destroy(effect);

                UpdateState(m_planetEffectsList.Count);
            }
        }
    }
示例#5
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.attachedRigidbody)
        {
            MTK_Interactable interactable = other.attachedRigidbody.GetComponent <MTK_Interactable>();
            if (interactable && interactable.isGrabbable && !interactable.isDistanceGrabbed)
            {
                UpdateTPZone(interactable.GetComponent <IcoPlanet>(), true);

                if (!other.attachedRigidbody.gameObject.GetComponent <PlanetEffect>())
                {
                    if (!other.GetComponentInParent <IcoSegment>())
                    {
                        PlanetEffect eff = other.attachedRigidbody.gameObject.AddComponent <PlanetEffect>();
                        if (eff)
                        {
                            eff.maxSpeed          = m_maxSpeed;
                            eff.accelerationForce = m_accelerationForce;
                            eff.impactForce       = impactForce;
                            eff.sunRigidbody      = m_rb;
                            m_planetEffectsList.Add(eff);

                            eff.explosionEffect = m_explosionEffect;

                            UpdateState(m_planetEffectsList.Count);

                            if (m_exclusionPlatform.m_objectsInTrigger.Contains(eff.gameObject))
                            {
                                eff.effectActive = false;
                                eff.GetComponent <Rigidbody>().useGravity = true;
                            }
                        }
                    }
                }
            }
        }
    }
示例#6
0
        /// <summary>
        /// The body of a load content method which
        /// allows us to load some basic stuff in here.
        /// </summary>
        /// <param name="content"></param>
        public override void LoadContent()
        {
            sphere.LoadContent();
            // load our model business in here
            Model = ResourceManager.Instance.GetResource<Model>("planet");
            Effect = new PlanetEffect(ResourceManager.Instance.GetResource<Effect>("PlanetEarthEffect"));

            // load the corresponding textures
            // that are needed to create a planet!
            ColorMap = ResourceManager.Instance.GetResource<Texture2D>("Earth_Diffuse");
            BumpMap = ResourceManager.Instance.GetResource<Texture2D>("Earth_NormalMap");
            GlowMap = ResourceManager.Instance.GetResource<Texture2D>("Earth_Night");
            ReflectionMap = ResourceManager.Instance.GetResource<Texture2D>("Earth_ReflectionMask");
            CloudMap = ResourceManager.Instance.GetResource<Texture2D>("Earth_Cloud");
            WaterMap = ResourceManager.Instance.GetResource<Texture2D>("WaterRipples");
            AtmosphereMap = ResourceManager.Instance.GetResource<Texture2D>("Earth_Atmosx");
        }