Exemple #1
0
    protected virtual void OnAwake()
    {
        mr = GetComponent <MeshRenderer>();

        if (mr != null)
        {
            switch (spriteType)
            {
            case SpriteType.Omni:
                mr.material = MaterialManager.Instance.omniBillboardMaterial;
                break;

            case SpriteType.Axis:
                mr.material = MaterialManager.Instance.axisBillboardMaterial;
                break;

            case SpriteType.TransparentOmni:
                mr.material = MaterialManager.Instance.transparentOmniBillboardMaterial;
                break;

            case SpriteType.TransparentAxis:
                mr.material = MaterialManager.Instance.transparentAxisBillboardMaterial;
                break;
            }
        }

        if (BehaviorType != BehaviorBase.Behaviors.None)
        {
            CurrentBehavior       = BehaviorBase.Instantiate(BehaviorType);
            CurrentBehavior.owner = this;
            CurrentBehavior.Init();
        }
    }