/// <summary> /// Set the object into the scene layer in the scene. /// </summary> /// <param name="jcsOlo"> object u want to set to that specific scene layer </param> /// <param name="orderLayerIndex"> index of scene layer </param> public void SetObjectParentToOrderLayerByOrderLayerIndex(ref JCS_OrderLayerObject jcsOlo, int orderLayerIndex) { if (jcsOlo == null) { JCS_Debug.LogWarning( "The 'JCS_OrderLayerObject' object you trying to set is null references..."); return; } // get the order layer by order layer index! JCS_OrderLayer jcsol = GetOrderLayerByOrderLayerIndex(orderLayerIndex); if (jcsol == null) { JCS_Debug.LogWarning( "Did not find the layer you willing to set to..., Layer Index: " + orderLayerIndex); return; } // set parent jcsOlo.transform.SetParent(jcsol.transform); // set order layer to the pass in object. jcsOlo.SetOrderLayer(orderLayerIndex); }
/* Functions */ protected override void Awake() { base.Awake(); mLiveObject = this.GetComponent <JCS_LiveObject>(); mOrderLayerObject = this.GetComponent <JCS_OrderLayerObject>(); }
/* Functions */ protected override void Awake() { base.Awake(); this.mAudioController = this.GetComponent <JCS_2DSideScrollerPlayerAudioController>(); this.mJCS2DAnimator = this.GetComponent <JCS_2DAnimator>(); this.mOrderLayerObject = this.GetComponent <JCS_OrderLayerObject>(); }
//======================================== // Unity's function //------------------------------ protected virtual void Awake() { this.mOrderLayerObject = this.GetComponent <JCS_OrderLayerObject>(); }
/// <summary> /// Set the object into the scene layer in the scene. /// </summary> /// <param name="jcsOlo"> this keyword does not pass through, use this function will do. </param> /// <param name="orderLayerIndex"> index of scene layer </param> public void SetObjectParentToOrderLayerByOrderLayerIndex(JCS_OrderLayerObject jcsOlo, int orderLayerIndex) { SetObjectParentToOrderLayerByOrderLayerIndex(ref jcsOlo, orderLayerIndex); }