Exemplo n.º 1
0
        public override sealed void Awake()
        {
            base.Awake();

            if (!bone)
            {
                bone = GetComponent <BoneModel>();
            }
            if (!bone)
            {
                bone = BasicHelpers.GetComponentInParents <BoneModel>(transform);
            }

            if (!bone.points.Contains(this))
            {
                bone.points.Add(this);
            }
            if (bone.transform == transform)
            {
                bone.point = this;
            }
            if (!bone.point)
            {
                bone.point = this;
            }
        }
Exemplo n.º 2
0
        public override sealed void Awake()
        {
            base.Awake();

            if (!transformRef)
            {
                transformRef = transform;
            }
            if (!meshRenderer)
            {
                meshRenderer = GetComponent <MeshRenderer>();
            }
            if (!skinnedMeshRenderer)
            {
                skinnedMeshRenderer = GetComponent <SkinnedMeshRenderer>();
            }
            if (!lineRenderer)
            {
                lineRenderer = GetComponent <LineRenderer>();
            }

            if (!point)
            {
                point = GetComponent <PointModel>();
            }
            if (!point)
            {
                point = BasicHelpers.GetComponentInParents <PointModel>(transform);
            }

            if (!point)
            {
                Debug.LogError("ReprModel " + transform.name + " has no point!");
                return;
            }
            else if (!point.reprs.ContainsValue(this))
            {
                if (key == null || key == "")
                {
                    key = FindKey();
                }

                if (key != null && key != "")
                {
                    if (!point.reprs.ContainsKey(key))
                    {
                        point.reprs.Add(key, this);
                    }
                    else
                    {
                        key = null;
                    }
                }
            }
        }