예제 #1
0
 // Create FCProp component
 void CreateFCProp()
 {
     // Create FCProp
     if (m_Prop == null)
     {
         m_Prop = this.GetComponent <FCProp>();
     }
     if (m_Prop == null)
     {
         m_Prop = this.gameObject.AddComponent <FCProp>();
     }
     //m_Prop.enabled = true;
 }
예제 #2
0
    // Get FCProp object
    public FCProp getProp()
    {
        if (m_Prop != null)
        {
            if (m_Prop.enabled == false)
            {
                return(null);
            }
        }
        else
        {
            m_Prop = this.GetComponent <FCProp>();
        }

        return(m_Prop);
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
#if USE_DOTWEEN        // use DOTween: https://www.assetstore.unity3d.com/en/#!/content/27676 Documentation: http://dotween.demigiant.com/documentation.php
        // DOTWEEN INITIALIZATION
        // Initialize DOTween (needs to be done only once).
        // If you don't initialize DOTween yourself,
        // it will be automatically initialized with default values.
        // DOTween.Init(false, true, LogBehaviour.ErrorsOnly);
#elif USE_HOTWEEN  // use HOTween: https://www.assetstore.unity3d.com/#/content/3311 Documentation:  http://hotween.demigiant.com/documentation.html
        // HOTWEEN INITIALIZATION
        // Must be done only once, before the creation of your first tween
        // (you can skip this if you want, and HOTween will be initialized automatically
        // when you create your first tween - using default values)
        HOTween.Init(true, true, true);
#elif USE_LEANTWEEN // use LeanTween: https://www.assetstore.unity3d.com/#/content/3595 Documentation: http://dentedpixel.com/LeanTweenDocumentation/classes/LeanTween.html
#else // use iTween: https://www.assetstore.unity3d.com/#/content/84 Documentation: http://itween.pixelplacement.com/documentation.php
#endif

        if (Application.isPlaying == true)
        {
            // Add mesh collider and make it fit to the chest
            if (m_CreateBoxCollider == true)
            {
                AddFitSizeBoxCollider();
                //SimpleConsole.print(this.name + ":AddFitSizeBoxCollider");
            }
        }

        // Get First Chest objects
        m_Lid           = getLid();
        m_Prop          = getProp();
        m_PropParticle  = getPropParticle();
        m_ChestParticle = getChestParticle();
        m_Sound         = getSound();

#if UNITY_EDITOR
        // Update in editor mode
        if (Application.isPlaying == false)
        {
            CreateFCLid();
            CreateFCProp();
            CreateFCPropParticle();
            CreateFCChestParticle();
            CreateFCSound();
        }
#endif
    }