void Start()
    {
        myTransform = transform;

        if (paintScriptObject == null)
        {
            paintScriptObject = GetComponent <TexturePaintInfluenceActor>();
        }
    }
Example #2
0
        public void Init(PaintChar paintChar)
        {
            _paintChar = paintChar;
            _transform = transform;
            _actor     = GetComponent <TexturePaintInfluenceActor>();
            _actor.colorDetails.addColor = false;

            _paintChar.FirstWaypoint.IsControlPoint = true;
            CurrentWaypoint = LastControlPoint = _paintChar.FirstWaypoint;

            _waypointList.AddRange(_paintChar.Waypoints.GetComponentsInChildren <Waypoint>());

            if (BrushMode == BrushModeType.Hand)
            {
                _paintChar.AddTapGestureComponent(TapGestureOnStateChanged);
                _background.gameObject.AddComponent <TouchScript.Hit.Untouchable.Untouchable>();
                _background.gameObject.GetComponent <BoxCollider>().enabled = false;
            }

            if (BrushMode == BrushModeType.HalfHand)
            {
                TapGesture = _background.gameObject.AddComponent <TouchScript.Gestures.TapGesture>();
                TapGesture.StateChanged += TapGestureOnStateChanged;

                _paintChar.AddComponentToParts(typeof(TouchScript.Hit.Untouchable.Untouchable));
                _halfHandPositionObject = new GameObject("HalfHandPositionObject");
            }

            ResetHeadPosition();


            TexturePaint.syncWithUpdate = true;

            if (BrushMode == BrushModeType.Autoplay)
            {
                RunAutoplay();
            }

            _paintChar.MoveNextCharPart();

            RunWayTrail(null);

            _isInited    = true;
            _isCompleted = false;
        }