Ejemplo n.º 1
0
 void Awake()
 {
     characterMotor  = GetComponent <CharacterMotor>();
     actionManager   = GetComponent <CharacterActionManager>();
     animationTarget = PelvisBone.GetComponent <Animation>();
     _myTransform    = this.transform;
 }
Ejemplo n.º 2
0
 public virtual void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     characterAnimation = target;
     characterTransform = character;
     characterManager   = actionManager;
     characterCollider  = masterCollider;
 }
Ejemplo n.º 3
0
	public override void Awake () {
	    
		base.Awake();
        //input = GetComponent<CharacterInputController>();
        myActionManager = GetComponent<CharacterActionManager>();
		if(!myStatus.myPhotonView.isMine)
			enabled = false;
	}
Ejemplo n.º 4
0
	public void Enable(CharacterActionManager actionManager)
	{
		cam = actionManager;
		if(actionAnimation.clip != null)
		{
			StartCoroutine(TransferAnimation(actionAnimation));
			Debug.Log("transferring new animation");
		}
		StartCoroutine(MainActionSequence());
	}
Ejemplo n.º 5
0
	public virtual void Initialise(PlayerCharacter status, int skillIndex)
	{
		ownerStatus = status;
		ownerManager = ownerStatus.actionManager;
		ownerCAM = (CharacterActionManager)ownerStatus.actionManager;
		ownerAnimation = ownerCAM.myAnimation;
		ownerTransform = ownerStatus._myTransform;
		skillID = skillIndex;
		ownerAvatar = ownerCAM.myAvatar;
		TransferSkillAnimations();
		BasicSetup();
	}
Ejemplo n.º 6
0
 void Start()
 {
     controller        = GetComponent <CharacterController>();
     input             = GetComponent <InputController>();
     avatar            = GetComponent <Avatar>();
     _myTransform      = transform;
     characterVelocity = Vector3.zero;
     animationManager  = GetComponent <CharacterActionManager>();
     //rigidbodyTransform = rigidbody.transform;
     SetRotAngle(_myTransform.position + (Vector3.forward * -10f));
     SetRotTarget();
     //UpdateAnimation();
 }
Ejemplo n.º 7
0
    /***************/

    #region skill state

    #endregion

    #region setup and unequip
    public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
    {
        base.Initialise(target, character, actionManager, masterCollider);
        TransferAnimations();
        if (weaponCollider != null)
        {
            TriggerCollider tc = weaponCollider.GetComponent <TriggerCollider>();
            if (tc != null)
            {
                tc.ownerCollider = characterCollider;
                tc.IgnoreCollision();
            }
            weaponCollider.SetActive(false);
        }
    }
Ejemplo n.º 8
0
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target,character, actionManager, masterCollider);
     TransferAnimations();
     if(weaponCollider != null)
     {
         TriggerCollider tc = weaponCollider.GetComponent<TriggerCollider>();
         if(tc != null)
         {
             tc.ownerCollider = characterCollider;
             tc.IgnoreCollision();
         }
         weaponCollider.SetActive(false);
     }
 }
	void Awake()
	{
		if (photonView.isMine)
		{
			this.enabled = false;   // due to this, Update() is not called on the owner client.
		}
		
		latestCorrectPos = transform.position;
		onUpdatePos = transform.position;

		_transform = transform;
		_motor = GetComponent<PlayerMotor>();
		myStatus = GetComponent<CharacterStatus>();
		actionManager = GetComponent<CharacterActionManager>();
	}
Ejemplo n.º 10
0
	// Use this for initialization
	public override void Awake () {
		base.Awake();
		characterType = CharacterType.Playable;
		enemyCharacterType = CharacterType.AI;
		shopItems = new List<ParseInventoryItem>();
		playerActionManager = GetComponent<CharacterActionManager>();

		if(myPhotonView.isMine)
		{
			this.tag = "Player";
		}
		else
		{
			this.tag = "OtherPlayer";
			avatar.RequestInitInfo();
			RequestShopItems();
		}
	}
Ejemplo n.º 11
0
 public virtual void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     characterAnimation = target;
     characterTransform = character;
     characterManager = actionManager;
     characterCollider = masterCollider;
 }
Ejemplo n.º 12
0
    public void LoadAvatar()
    {
		//SUPER HACK
		if(NetworkManager.Instance.offlineMode || GameManager.Instance.teststate && !GameManager.Instance.newGame)
			StartNewGame();

		avatarObject = PhotonNetwork.Instantiate("PlayerAvatar", SpawnPoint.position , Quaternion.identity, 0) as GameObject;
		//avatarObject = GameObject.Instantiate(Resources.Load("PlayerAvatar"), SpawnPoint.position, Quaternion.identity) as GameObject;
		//avatarObject.AddComponent<DontDestroy>();
		avatarStatus = avatarObject.GetComponent<PlayerCharacter>();
		avatarInput = avatarObject.GetComponent<CharacterInputController>();
		avatarActionManager = avatarObject.GetComponent<CharacterActionManager>();
		//PlayerMotor cm = avatarObject.GetComponent<PlayerMotor>();
		//cm.enabled = true;
		//avatarInput.enabled = true;
		avatarNetworkMovement = avatarObject.GetComponent<NetworkCharacterMovement>();
		//UICamera.fallThrough = avatarObject;
		avatar = avatarObject.GetComponent<Avatar>();
		avatarPhotonView = avatarObject.GetComponent<PhotonView>();
		Invoke("RefreshAvatar", 0.1f);
		//PlayerCamera.Instance.targetTransform = avatarObject.transform;
		//LoadCharacterParts();
    }
Ejemplo n.º 13
0
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target,character, actionManager, masterCollider);
     TransferAnimations();
     currentAmmoCount = maxAmmoCount;
 }
Ejemplo n.º 14
0
 // Use this for initialization
 #region setup and unequip
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target, character, actionManager, masterCollider);
     TransferAnimations();
     currentAmmoCount = maxAmmoCount;
 }
Ejemplo n.º 15
0
	void Awake () {
        myMotor = GetComponent<PlayerMotor>();
        myActionManager = GetComponent<CharacterActionManager>();
        animationTarget = PelvisBone.GetComponent<Animation>();
        _myTransform = this.transform;
        myStatus = GetComponent<PlayerCharacter>();
		LoadBones();
	}
Ejemplo n.º 16
0
 public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
 {
     base.Initialise(target,character, actionManager, masterCollider);
     TransferAnimations();
     Debug.Log("override");
 }
Ejemplo n.º 17
0
 void Awake()
 {
     characterMotor = GetComponent<CharacterMotor>();
     actionManager = GetComponent<CharacterActionManager>();
     animationTarget = PelvisBone.GetComponent<Animation>();
     _myTransform = this.transform;
 }
Ejemplo n.º 18
0
 void Start()
 {
     controller=GetComponent<CharacterController>();
     input = GetComponent<InputController>();
     avatar = GetComponent<Avatar>();
     _myTransform = transform;
     characterVelocity = Vector3.zero;
     animationManager = GetComponent<CharacterActionManager>();
     //rigidbodyTransform = rigidbody.transform;
     SetRotAngle(_myTransform.position+(Vector3.forward * -10f));
     SetRotTarget();
     //UpdateAnimation();
 }
Ejemplo n.º 19
0
    /***************/



    #region setup and unequip
    public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider)
    {
        base.Initialise(target, character, actionManager, masterCollider);
        TransferAnimations();
        Debug.Log("override");
    }